]> git.mxchange.org Git - friendica.git/blobdiff - src/Object/Api/Twitter/Status.php
Use the owner, not the author
[friendica.git] / src / Object / Api / Twitter / Status.php
index 9c1d5d37460317bd8c5f47672480a8093f9cbd57..f9ce6a209d65ad003c97f1aa6c462ff39ee479bb 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -100,13 +100,13 @@ class Status extends BaseDataTransferObject
         */
        public function __construct(string $text, string $statusnetHtml, string $friendicaHtml, array $item, User $author, User $owner, array $retweeted, array $quoted, array $geo, array $friendica_activities, array $entities, array $attachments, int $friendica_comments, bool $liked)
        {
-               $this->id                        = (int)$item['id'];
-               $this->id_str                    = (string)$item['id'];
-               $this->statusnet_conversation_id = (int)$item['parent'];
+               $this->id                        = (int)$item['uri-id'];
+               $this->id_str                    = (string)$item['uri-id'];
+               $this->statusnet_conversation_id = (int)$item['parent-uri-id'];
 
                $this->created_at = DateTimeFormat::utc($item['created'], DateTimeFormat::API);
 
-               if ($item['gravity'] == GRAVITY_COMMENT) {
+               if ($item['gravity'] == Item::GRAVITY_COMMENT) {
                        $this->in_reply_to_status_id     = (int)$item['thr-parent-id'];
                        $this->in_reply_to_status_id_str = (string)$item['thr-parent-id'];
                        $this->in_reply_to_user_id       = (int)$item['parent-author-id'];
@@ -118,7 +118,7 @@ class Status extends BaseDataTransferObject
                $this->friendica_title      = $item['title'];
                $this->statusnet_html       = $statusnetHtml;
                $this->friendica_html       = $friendicaHtml;
-               $this->user                 = $author->toArray();
+               $this->user                 = $owner->toArray();
                $this->friendica_author     = $author->toArray();
                $this->friendica_owner      = $owner->toArray();
                $this->truncated            = false;