]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/ActivityPub/ClientToServer.php
Ensure to transmit the audience if the parent does so
[friendica.git] / src / Protocol / ActivityPub / ClientToServer.php
index 48a5cfdec5aed3f5ccc23dcbf91769d216723357..2b52d17b767dc22ef39bf7519182aabfd1ff9f32 100644 (file)
@@ -28,7 +28,7 @@ use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\APContact;
 use Friendica\Model\Contact;
-use Friendica\Model\Group;
+use Friendica\Model\Circle;
 use Friendica\Model\Item;
 use Friendica\Model\Post;
 use Friendica\Model\User;
@@ -208,7 +208,7 @@ class ClientToServer
 
                $targets = [];
 
-               foreach (['as:to', 'as:cc', 'as:bto', 'as:bcc'] as $element) {
+               foreach (['as:to', 'as:cc', 'as:bto', 'as:bcc', 'as:audience'] as $element) {
                        switch ($element) {
                                case 'as:to':
                                        $type = Receiver::TARGET_TO;
@@ -222,6 +222,9 @@ class ClientToServer
                                case 'as:bcc':
                                        $type = Receiver::TARGET_BCC;
                                        break;
+                               case 'as:audience':
+                                       $type = Receiver::TARGET_AUDIENCE;
+                                       break;
                        }
                        $receiver_list = JsonLD::fetchElementArray($object, $element, '@id');
                        if (empty($receiver_list)) {
@@ -281,7 +284,7 @@ class ClientToServer
                        $item['private']   = Item::UNLISTED;
                } elseif (!empty($object_data['target'][Receiver::TARGET_FOLLOWER])) {
                        $item['allow_cid'] = '';
-                       $item['allow_gid'] = '<' . Group::FOLLOWERS . '>';
+                       $item['allow_gid'] = '<' . Circle::FOLLOWERS . '>';
                        $item['deny_cid']  = '';
                        $item['deny_gid']  = '';
                        $item['private']   = Item::PRIVATE;