$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 ($target_item['origin']) {
+ $inboxes = ActivityPub::fetchTargetInboxes($target_item, $uid);
+ }
- if ($parent['origin']) {
- $parent_inboxes = ActivityPub::fetchTargetInboxes($parent);
- $inboxes = array_merge($inboxes, $parent_inboxes);
- }
+ 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);
+ 'APDelivery', $cmd, $item_id, $inbox, $uid);
}
// send salmon slaps to mentioned remote tags (@foo@example.com) in OStatus posts