From fcb245947e68adb3a035de0419b8ecee805c78cc Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 2 May 2022 06:10:36 +0000 Subject: [PATCH] Fetch the receiver list from sharedinbox or personal inbox --- src/Worker/APDelivery.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Worker/APDelivery.php b/src/Worker/APDelivery.php index 6a1241293e..370e3713ca 100644 --- a/src/Worker/APDelivery.php +++ b/src/Worker/APDelivery.php @@ -112,15 +112,14 @@ class APDelivery if (empty($receivers) && !empty($item)) { $parent = Post::selectFirst(Item::DELIVER_FIELDLIST, ['id' => $item['parent']]); - if ($item['origin']) { - $inboxes = ActivityPub\Transmitter::fetchTargetInboxes($parent, $uid); - } else { - // Remote items are transmitted via the personal inboxes. - // Doing so ensures that the dedicated receiver will get the message. - $inboxes = ActivityPub\Transmitter::fetchTargetInboxes($parent, $uid, true, $item_id); - } - + $inboxes = ActivityPub\Transmitter::fetchTargetInboxes($parent, $uid); $receivers = $inboxes[$inbox] ?? []; + + // When we haven't fetched the receiver list, it can be a personal inbox + if (empty($receivers)) { + $inboxes = ActivityPub\Transmitter::fetchTargetInboxes($parent, $uid, true); + $receivers = $inboxes[$inbox] ?? []; + } } }