From 59cd6611ec3b28fc48f6a0faca9bf31367b4ae72 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 21 Sep 2018 05:41:18 +0000 Subject: [PATCH] Direkt delivery is done --- src/Worker/Notifier.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index 693a9e343..3e73b5b5e 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -414,7 +414,25 @@ class Notifier } } - $inboxes = ActivityPub::fetchTargetInboxes($target_item); + $inboxes = []; + + if ($followup) { + $profile = ActivityPub::fetchprofile($parent['author-link']); + if (!empty($profile)) { + $target = defaults($profile, 'sharedinbox', $profile['inbox']); + $inboxes[$target] = $target; + } + } else { + if ($target_item['origin']) { + $inboxes = ActivityPub::fetchTargetInboxes($target_item); + } + + if ($parent['origin']) { + $parent_inboxes = ActivityPub::fetchTargetInboxes($parent); + $inboxes = array_merge($inboxes, $parent_inboxes); + } + } + foreach ($inboxes as $inbox) { logger('Deliver ' . $item_id .' to ' . $inbox .' via ActivityPub', LOGGER_DEBUG);