1
1
Fork 0

Avoid duplicated delivery to Diaspora

This commit is contained in:
Michael 2018-10-30 17:34:18 +00:00
parent 92c9c940f4
commit f7f96e971a

View file

@ -412,13 +412,17 @@ class Notifier
if (!empty($networks)) { if (!empty($networks)) {
$condition['network'] = $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); $r = DBA::toArray($contacts);
} }
// delivery loop // delivery loop
if (DBA::isResult($r)) { if (DBA::isResult($r)) {
foreach ($r as $contact) { 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); 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], Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],