From b464cd6181ebb4b48fe287d2374ce665a4fe92a3 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 3 Dec 2025 19:05:17 +0000 Subject: [PATCH] this is somehow delicate: make sure we will not relay an item again in case it comes back to us from a channel that sources our channel --- Zotlabs/Daemon/Notifier.php | 1 - Zotlabs/Lib/Libzot.php | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 81a17d8fe..47a1248ef 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -266,7 +266,6 @@ class Notifier { } if (!item_forwardable($target_item)) { - //hz_syslog(print_r($target_item,true)); logger('notifier: target item not forwardable', LOGGER_DEBUG); return; } diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 583fa4b5c..d513b6fdd 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -1897,11 +1897,13 @@ class Libzot { else { $DR->update('update ignored'); $result[] = $DR->get(); - // We need this line to ensure wall-to-wall comments and add/remove activities are relayed (by falling through to the relay bit), // and at the same time not relay any other relayable posts more than once, because to do so is very wasteful. - if (!intval($r[0]['item_origin'])) + + // The second part should prevent possible items that come back to us from channels that source our channel from being relayed again (sender != owner or author). + if (!intval($r[0]['item_origin']) || (intval($r[0]['item_origin']) && !in_array($sender, [$r[0]['owner_xchan'], $r[0]['author_xchan']]))) { continue; + } }