From f7f96e971ac017b217252ee8c74f1b287ea4a79e Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 30 Oct 2018 17:34:18 +0000 Subject: [PATCH] Avoid duplicated delivery to Diaspora --- src/Worker/Notifier.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index 480938ec53..d4ec33b2ca 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -412,13 +412,17 @@ class Notifier if (!empty($networks)) { $condition['network'] = $networks; } - $contacts = DBA::select('contact', ['id', 'url', 'network'], $condition); + $contacts = DBA::select('contact', ['id', 'url', 'network', 'batch'], $condition); $r = DBA::toArray($contacts); } // delivery loop if (DBA::isResult($r)) { foreach ($r as $contact) { + if (($contact['network'] == Protocol::DIASPORA) && $diaspora_delivery && $public_message && !empty($contact['batch']) + && !in_array($cmd, [Delivery::MAIL, Delivery::SUGGESTION]) && !$followup) { + continue; + } logger("Deliver ".$item_id." to ".$contact['url']." via network ".$contact['network'], LOGGER_DEBUG); Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],