]> git.mxchange.org Git - friendica.git/commitdiff
Change visibility data on Mastodon posts to be array of IDs
authorHank Grabowski <hankgrabowski@gmail.com>
Tue, 21 Mar 2023 17:15:42 +0000 (13:15 -0400)
committerHank Grabowski <hankgrabowski@gmail.com>
Tue, 21 Mar 2023 17:15:42 +0000 (13:15 -0400)
src/Factory/Api/Mastodon/Status.php
src/Object/Api/Mastodon/Status/FriendicaVisibility.php

index 416321c248b068eeb042cad9b768856999579605..62941978ec14d7ce43b8ccbcacd150a85be4a1f8 100644 (file)
@@ -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);
index 2eeaf2ecd49d3b31b79a51a4b46172ef5798304e..6ded2bfc36e6cf88e12c12dc28bb79fc213b3f24 100644 (file)
@@ -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;