}
}
- $inboxes = ActivityPub::fetchTargetInboxes($target_item);
+ $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);