From: Hank Grabowski Date: Tue, 21 Mar 2023 17:15:42 +0000 (-0400) Subject: Change visibility data on Mastodon posts to be array of IDs X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=60f2c67b66511da599c7764ed6a7186ed9ab2b43;p=friendica.git Change visibility data on Mastodon posts to be array of IDs --- diff --git a/src/Factory/Api/Mastodon/Status.php b/src/Factory/Api/Mastodon/Status.php index 416321c248..62941978ec 100644 --- a/src/Factory/Api/Mastodon/Status.php +++ b/src/Factory/Api/Mastodon/Status.php @@ -28,6 +28,7 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\Logger; use Friendica\Database\Database; use Friendica\Database\DBA; +use Friendica\DI; use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Model\Tag as TagModel; @@ -291,8 +292,9 @@ class Status extends BaseFactory $in_reply = []; } + $aclFormatter = DI::aclFormatter(); $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($item['allow_cid'], $item['deny_cid'], $item['allow_gid'], $item['deny_gid']); + $visibility_data = $uid != $item['uid'] ? null : new FriendicaVisibility($aclFormatter->expand($item['allow_cid']), $aclFormatter->expand($item['deny_cid']), $aclFormatter->expand($item['allow_gid']), $aclFormatter->expand($item['deny_gid'])); $friendica = new FriendicaExtension($item['title'], $item['changed'], $item['commented'], $item['received'], $counts->dislikes, $delivery_data, $visibility_data); return new \Friendica\Object\Api\Mastodon\Status($item, $account, $counts, $userAttributes, $sensitive, $application, $mentions, $tags, $card, $attachments, $in_reply, $reshare, $friendica, $quote, $poll); diff --git a/src/Object/Api/Mastodon/Status/FriendicaVisibility.php b/src/Object/Api/Mastodon/Status/FriendicaVisibility.php index 2eeaf2ecd4..6ded2bfc36 100644 --- a/src/Object/Api/Mastodon/Status/FriendicaVisibility.php +++ b/src/Object/Api/Mastodon/Status/FriendicaVisibility.php @@ -32,16 +32,16 @@ use Friendica\BaseDataTransferObject; */ class FriendicaVisibility extends BaseDataTransferObject { - /** @var string|null */ + /** @var array */ protected $allow_cid; - /** @var string|null */ + /** @var array */ protected $deny_cid; - /** @var string|null */ + /** @var array */ protected $allow_gid; - /** @var string|null */ + /** @var array */ protected $deny_gid; - public function __construct(?string $allow_cid, ?string $deny_cid, ?string $allow_gid, ?string $deny_gid) + public function __construct(array $allow_cid, array $deny_cid, array $allow_gid, array $deny_gid) { $this->allow_cid = $allow_cid; $this->deny_cid = $deny_cid;