From 9261f2955382f8d0b99a847b698ca1dc853a3b01 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 26 Oct 2024 15:34:17 +0000 Subject: [PATCH] Issue 14495: Rich HTML content with embedded pictures --- src/Factory/Api/Mastodon/Status.php | 4 ++-- src/Object/Api/Mastodon/Status/FriendicaExtension.php | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Factory/Api/Mastodon/Status.php b/src/Factory/Api/Mastodon/Status.php index 005ab68085..cd02890f2d 100644 --- a/src/Factory/Api/Mastodon/Status.php +++ b/src/Factory/Api/Mastodon/Status.php @@ -328,7 +328,7 @@ class Status extends BaseFactory $delivery_data = $uid != $item['uid'] ? null : new FriendicaDeliveryData($item['delivery_queue_count'], $item['delivery_queue_done'], $item['delivery_queue_failed']); $visibility_data = $uid != $item['uid'] ? null : new FriendicaVisibility($this->aclFormatter->expand($item['allow_cid']), $this->aclFormatter->expand($item['deny_cid']), $this->aclFormatter->expand($item['allow_gid']), $this->aclFormatter->expand($item['deny_gid'])); - $friendica = new FriendicaExtension($item['title'] ?? '', $item['changed'], $item['commented'], $item['received'], $counts->dislikes, $origin_dislike, $network, $platform, $version, $sitename, $delivery_data, $visibility_data); + $friendica = new FriendicaExtension($item['title'] ?? '', $item['changed'], $item['commented'], $item['received'], $counts->dislikes, $origin_dislike, $network, $platform, $version, $sitename, $delivery_data, $visibility_data, BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::EXTERNAL)); return new \Friendica\Object\Api\Mastodon\Status($item, $account, $counts, $userAttributes, $sensitive, $application, $mentions, $tags, $card, $attachments, $in_reply, $reshare, $friendica, $quote, $poll, $emojis); } @@ -399,7 +399,7 @@ class Status extends BaseFactory $attachments = []; $in_reply = []; $reshare = []; - $friendica = new FriendicaExtension('', null, null, null, 0, false, null, null, null, null, null, null); + $friendica = new FriendicaExtension('', null, null, null, 0, false, null, null, null, null, null, null, BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::EXTERNAL)); return new \Friendica\Object\Api\Mastodon\Status($item, $account, $counts, $userAttributes, $sensitive, $application, $mentions, $tags, $card, $attachments, $in_reply, $reshare, $friendica); } diff --git a/src/Object/Api/Mastodon/Status/FriendicaExtension.php b/src/Object/Api/Mastodon/Status/FriendicaExtension.php index cca002c7a1..4564be254b 100644 --- a/src/Object/Api/Mastodon/Status/FriendicaExtension.php +++ b/src/Object/Api/Mastodon/Status/FriendicaExtension.php @@ -57,6 +57,9 @@ class FriendicaExtension extends BaseDataTransferObject */ protected $visibility; + /** @var string|null */ + protected $content; + /** * Creates a FriendicaExtension object * @@ -86,7 +89,8 @@ class FriendicaExtension extends BaseDataTransferObject ?string $version, ?string $sitename, ?FriendicaDeliveryData $delivery_data, - ?FriendicaVisibility $visibility + ?FriendicaVisibility $visibility, + ?string $content ) { $this->title = $title; $this->changed_at = $changed_at ? DateTimeFormat::utc($changed_at, DateTimeFormat::JSON) : null; @@ -100,6 +104,7 @@ class FriendicaExtension extends BaseDataTransferObject $this->version = $version; $this->sitename = $sitename; $this->visibility = $visibility; + $this->content = $content; } /**