X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FNotifier.php;h=e4189c2c75c4b2fb12e1c09c8d2a8ff466c734f9;hb=ba4860b7879f0dc6ea7a2dd0d09e698a913a9129;hp=2e8721feee48fc7502ef41fcea269015ebdc6088;hpb=78c3c56ca56ee0c34eca24431a9b7feb4baee1ca;p=friendica.git diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index 2e8721feee..e4189c2c75 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -517,7 +517,11 @@ class Notifier foreach ($contacts as $contact) { // Direct delivery of local contacts - if (!in_array($cmd, [Delivery::RELOCATION, Delivery::SUGGESTION, Delivery::DELETION, Delivery::MAIL]) && $target_uid = User::getIdForURL($contact['url'])) { + if (!in_array($cmd, [Delivery::RELOCATION, Delivery::SUGGESTION, Delivery::MAIL]) && $target_uid = User::getIdForURL($contact['url'])) { + if ($cmd == Delivery::DELETION) { + Logger::info('No need to deliver deletions internally', ['uid' => $target_uid, 'guid' => $target_item['guid'], 'uri-id' => $target_item['uri-id'], 'uri' => $target_item['uri']]); + continue; + } if ($target_item['origin'] || ($target_item['network'] != Protocol::ACTIVITYPUB)) { if ($target_uid != $target_item['uid']) { $fields = ['protocol' => Conversation::PARCEL_LOCAL_DFRN, 'direction' => Conversation::PUSH, 'post-reason' => Item::PR_DIRECT]; @@ -593,7 +597,8 @@ class Notifier if (!empty($contact['gsid']) && DI::config()->get('system', 'bulk_delivery')) { $delivery_queue_count++; - Delivery::addQueue($cmd, $post_uriid, $target_item['created'], $contact['id'], $contact['gsid'], $sender_uid); + $deliveryQueueItem = DI::deliveryQueueItemFactory()->createFromDelivery($cmd, $post_uriid, new \DateTimeImmutable($target_item['created']), $contact['id'], $contact['gsid'], $sender_uid); + DI::deliveryQueueItemRepo()->save($deliveryQueueItem); Worker::add(['priority' => Worker::PRIORITY_HIGH, 'dont_fork' => true], 'BulkDelivery', $contact['gsid']); } else { if (Worker::add($deliver_options, 'Delivery', $cmd, $post_uriid, (int)$contact['id'], $sender_uid)) { @@ -838,7 +843,11 @@ class Notifier if ((count($receivers) == 1) && Network::isLocalLink($inbox)) { $contact = Contact::getById($receivers[0], ['url']); - if (!in_array($cmd, [Delivery::RELOCATION, Delivery::SUGGESTION, Delivery::DELETION, Delivery::MAIL]) && ($target_uid = User::getIdForURL($contact['url']))) { + if (!in_array($cmd, [Delivery::RELOCATION, Delivery::SUGGESTION, Delivery::MAIL]) && ($target_uid = User::getIdForURL($contact['url']))) { + if ($cmd == Delivery::DELETION) { + Logger::info('No need to deliver deletions internally', ['uid' => $target_uid, 'guid' => $target_item['guid'], 'uri-id' => $target_item['uri-id'], 'uri' => $target_item['uri']]); + continue; + } if ($target_item['origin'] || ($target_item['network'] != Protocol::ACTIVITYPUB)) { if ($target_uid != $target_item['uid']) { $fields = ['protocol' => Conversation::PARCEL_LOCAL_DFRN, 'direction' => Conversation::PUSH, 'post-reason' => Item::PR_BCC];