Clarify usage of ActivityPub\Transmitter::fetchTargetInboxes in Worker\APDelivery queuing

- $inbox is now always a string
- $receivers should be correctly populated now
- $target_id is renamed to $item_id and correctly initialized to 0 for non-item deliveries
This commit is contained in:
Hypolite Petovan 2020-12-14 23:33:14 -05:00
parent e4228c6218
commit d59fcd5093
3 changed files with 19 additions and 41 deletions

View file

@ -40,10 +40,10 @@ class ProfileUpdate {
$inboxes = ActivityPub\Transmitter::fetchTargetInboxesforUser($uid);
foreach ($inboxes as $inbox) {
foreach ($inboxes as $inbox => $receivers) {
Logger::log('Profile update for user ' . $uid . ' to ' . $inbox .' via ActivityPub', Logger::DEBUG);
Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],
'APDelivery', Delivery::PROFILEUPDATE, '', $inbox, $uid);
'APDelivery', Delivery::PROFILEUPDATE, 0, $inbox, $uid, $receivers);
}
Diaspora::sendProfile($uid);