]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/Notifier.php
all endpoints are now working
[friendica.git] / src / Worker / Notifier.php
index 61eaba388b2d365a58829bcf4abddcb1bda54874..b457b7800851177c4254f505e4ef515c5c290992 100644 (file)
@@ -16,6 +16,7 @@ use Friendica\Model\Item;
 use Friendica\Model\PushSubscriber;
 use Friendica\Model\User;
 use Friendica\Network\Probe;
+use Friendica\Protocol\ActivityPub;
 use Friendica\Protocol\Diaspora;
 use Friendica\Protocol\OStatus;
 use Friendica\Protocol\Salmon;
@@ -413,6 +414,24 @@ class Notifier
                        }
                }
 
+               $inboxes = [];
+
+               if ($target_item['origin']) {
+                       $inboxes = ActivityPub::fetchTargetInboxes($target_item, $uid);
+               }
+
+               if ($parent['origin']) {
+                       $parent_inboxes = ActivityPub::fetchTargetInboxes($parent, $uid);
+                       $inboxes = array_merge($inboxes, $parent_inboxes);
+               }
+
+               foreach ($inboxes as $inbox) {
+                       logger('Deliver ' . $item_id .' to ' . $inbox .' via ActivityPub', LOGGER_DEBUG);
+
+                       Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],
+                                       'APDelivery', $cmd, $item_id, $inbox, $uid);
+               }
+
                // send salmon slaps to mentioned remote tags (@foo@example.com) in OStatus posts
                // They are especially used for notifications to OStatus users that don't follow us.
                if (!Config::get('system', 'dfrn_only') && count($url_recipients) && ($public_message || $push_notify) && $normal_mode) {