From 29310562a5d9e590a3b0a905f90f93927da2fde8 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Nov 2024 07:41:14 +0000 Subject: [PATCH] Notifier: Only relay public posts --- src/Worker/Notifier.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index 4dbbcc5076..438c0e5e77 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -169,7 +169,7 @@ class Notifier if (!$target_item['origin'] && $target_item['network'] == Protocol::ACTIVITYPUB) { $only_ap_delivery = true; $diaspora_delivery = false; - Logger::debug('Only AP Delivery', ['guid' => $target_item['guid'], 'uri-id' => $target_item['uri-id'], 'network' => $target_item['network'], 'parent-network' => $parent['network'], 'thread-parent-network' => $thr_parent['network']]); + Logger::debug('Remote post arrived via AP', ['guid' => $target_item['guid'], 'uri-id' => $target_item['uri-id'], 'network' => $target_item['network'], 'parent-network' => $parent['network'], 'thread-parent-network' => $thr_parent['network']]); } // Only deliver threaded replies (comment to a comment) to Diaspora @@ -683,10 +683,10 @@ class Notifier Logger::info('Origin item will be distributed', ['id' => $target_item['id'], 'url' => $target_item['uri'], 'verb' => $target_item['verb']]); $check_signature = false; - } elseif (!Post\Activity::exists($target_item['uri-id'])) { - Logger::info('Remote item is no AP post. It will not be distributed.', ['id' => $target_item['id'], 'url' => $target_item['uri'], 'verb' => $target_item['verb']]); + } elseif (!$target_item['deleted'] && !Post\Activity::exists($target_item['uri-id'])) { + Logger::info('Remote activity not found. It will not be distributed.', ['id' => $target_item['id'], 'url' => $target_item['uri'], 'verb' => $target_item['verb']]); return ['count' => 0, 'contacts' => []]; - } elseif ($parent['origin'] && (($target_item['gravity'] != Item::GRAVITY_ACTIVITY) || DI::config()->get('system', 'redistribute_activities'))) { + } elseif ($parent['origin'] && ($target_item['private'] != Item::PRIVATE) && (($target_item['gravity'] != Item::GRAVITY_ACTIVITY) || DI::config()->get('system', 'redistribute_activities'))) { $inboxes = ActivityPub\Transmitter::fetchTargetInboxes($parent, $uid); if (in_array($target_item['private'], [Item::PUBLIC])) {