X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FNotifier.php;h=7d3d3d6b7cc7033a1a8d06d18d78361d7e893c42;hb=0e82f64d71b598a1349ac22973148715f7182fdd;hp=7921097d4a466eb707439823095b22998c02e9e3;hpb=6557efd786d2ab1f7be1a9884fb5dd2438fba0de;p=friendica.git diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index 7921097d4a..7d3d3d6b7c 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -191,6 +191,10 @@ class Notifier // when the original comment author does support the Diaspora protocol. if ($thr_parent['author-link'] && $target_item['parent-uri'] != $target_item['thr-parent']) { $diaspora_delivery = Diaspora::isSupportedByContactUrl($thr_parent['author-link']); + if ($diaspora_delivery && empty($target_item['signed_text'])) { + Logger::debug('Post has got no Diaspora signature, so there will be no Diaspora delivery', ['guid' => $target_item['guid'], 'uri-id' => $target_item['uri-id']]); + $diaspora_delivery = false; + } Logger::info('Threaded comment', ['diaspora_delivery' => (int)$diaspora_delivery]); } @@ -502,7 +506,7 @@ class Notifier $a = DI::app(); $delivery_queue_count = 0; - if ($target_item['verb'] == Activity::ANNOUNCE) { + if (!empty($target_item['verb']) && ($target_item['verb'] == Activity::ANNOUNCE)) { Logger::notice('Announces are only delivery via ActivityPub', ['cmd' => $cmd, 'id' => $target_item['id'], 'guid' => $target_item['guid'], 'uri-id' => $target_item['uri-id'], 'uri' => $target_item['uri']]); return 0; } @@ -573,6 +577,7 @@ class Notifier if (Worker::add($deliver_options, 'Delivery', $cmd, $post_uriid, (int)$contact['id'], $sender_uid)) { $delivery_queue_count++; } + Worker::coolDown(); } return $delivery_queue_count; } @@ -695,6 +700,7 @@ class Notifier Logger::info('Account removal via ActivityPub', ['uid' => $self_user_id, 'inbox' => $inbox]); Worker::add(['priority' => PRIORITY_NEGLIGIBLE, 'created' => $created, 'dont_fork' => true], 'APDelivery', Delivery::REMOVAL, 0, $inbox, $self_user_id, $receivers); + Worker::coolDown(); } return true; @@ -818,6 +824,7 @@ class Notifier $delivery_queue_count++; } } + Worker::coolDown(); } // We deliver posts to relay servers slightly delayed to priorize the direct delivery @@ -833,6 +840,7 @@ class Notifier $delivery_queue_count++; } } + Worker::coolDown(); } return ['count' => $delivery_queue_count, 'contacts' => $contacts];