]> git.mxchange.org Git - friendica.git/commitdiff
Fetch the receiver from the parent posting as well
authorMichael <heluecht@pirati.ca>
Fri, 21 Sep 2018 04:51:54 +0000 (04:51 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 21 Sep 2018 04:51:54 +0000 (04:51 +0000)
src/Protocol/ActivityPub.php

index c064ffa39634fa594b9dabcf19380dadec242690..edc3de3f3b4e3b7dadaf04665ee0bba366b3e5bf 100644 (file)
@@ -829,6 +829,15 @@ class ActivityPub
        {
                $receivers = [];
 
+               // When it is an answer, we inherite the receivers from the parent
+               $replyto = JsonLD::fetchElement($activity, 'inReplyTo', 'id');
+               if (!empty($replyto)) {
+                       $parents = Item::select(['uid'], ['uri' => $replyto]);
+                       while ($parent = Item::fetch($parents)) {
+                               $receivers['uid:' . $parent['uid']] = $parent['uid'];
+                       }
+               }
+
                if (!empty($actor)) {
                        $profile = self::fetchprofile($actor);
                        $followers = defaults($profile, 'followers', '');
@@ -1211,6 +1220,7 @@ class ActivityPub
                $activity['object'] = $object;
                $activity['published'] = $object['published'];
                $activity['type'] = 'Create';
+
                self::processActivity($activity);
                logger('Activity ' . $url . ' had been fetched and processed.');
        }