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

This commit is contained in:
Mario
2025-12-03 19:05:17 +00:00
parent 63243808b8
commit b464cd6181
2 changed files with 4 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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;
}
}