Fetch the receiver list from sharedinbox or personal inbox

This commit is contained in:
Michael 2022-05-02 06:10:36 +00:00
parent 9c2fe81ac6
commit fcb245947e

View File

@ -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);
}
$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] ?? [];
}
}
}