From 5310d54c130d0fabd952250b5fd924b567578c6d Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 21 Sep 2018 04:51:54 +0000 Subject: [PATCH] Fetch the receiver from the parent posting as well --- src/Protocol/ActivityPub.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Protocol/ActivityPub.php b/src/Protocol/ActivityPub.php index c064ffa396..edc3de3f3b 100644 --- a/src/Protocol/ActivityPub.php +++ b/src/Protocol/ActivityPub.php @@ -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.'); } -- 2.39.5