$reshare = [];
}
- return new \Friendica\Object\Api\Mastodon\Status($item, $account, $counts, $userAttributes, $sensitive, $application, $mentions, $tags, $card, $attachments, $reshare, $poll);
+ if (!empty($item['quote-uri-id'])) {
+ $quote = $this->createFromUriId($item['quote-uri-id'], $uid, false)->toArray();
+ } else {
+ $quote = [];
+ }
+
+ return new \Friendica\Object\Api\Mastodon\Status($item, $account, $counts, $userAttributes, $sensitive, $application, $mentions, $tags, $card, $attachments, $reshare, $quote, $poll);
}
/**
protected $content;
/** @var Status|null */
protected $reblog = null;
+ /** @var Status|null */
+ protected $quote = null;
/** @var Application */
protected $application = null;
/** @var Account */
* @param array $item
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public function __construct(array $item, Account $account, Counts $counts, UserAttributes $userAttributes, bool $sensitive, Application $application, array $mentions, array $tags, Card $card, array $attachments, array $reblog, array $poll = null)
+ public function __construct(array $item, Account $account, Counts $counts, UserAttributes $userAttributes, bool $sensitive, Application $application, array $mentions, array $tags, Card $card, array $attachments, array $reblog, array $quote = null, array $poll = null)
{
$this->id = (string)$item['uri-id'];
$this->created_at = DateTimeFormat::utc($item['created'], DateTimeFormat::JSON);
$this->pinned = $userAttributes->pinned;
$this->content = BBCode::convertForUriId($item['uri-id'], BBCode::setMentionsToNicknames($item['raw-body'] ?? $item['body']), BBCode::MASTODON_API);
$this->reblog = $reblog;
+ $this->quote = $quote;
$this->application = $application->toArray();
$this->account = $account->toArray();
$this->media_attachments = $attachments;
$status['reblog'] = null;
}
+ if (empty($status['quote'])) {
+ $status['quote'] = null;
+ }
+
return $status;
}
}