From a1818b1a29974132e16fb68c65c1b3a9904a5b18 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 10 Oct 2024 15:10:51 +0200 Subject: document some special handling --- Zotlabs/Lib/Libzot.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Lib/Libzot.php') diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 3f339a21a..a9b24974d 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -1876,12 +1876,16 @@ class Libzot { dbesc($arr['author_xchan']) ); - // Reactions such as like and dislike could have an mid with /activity/ in it. - // Check for both forms in order to prevent duplicates. + // If we import an add/remove activity ($is_collection_operation) we strip off the + // add/remove part and only process the object. + // When looking up the item to pass it to the notifier for relay, we need to look up + // the original (stripped off) message id which we stored in $act->meta. - // If we process an add/remove activity, look for the original activity id instead of the object id $sql_mid = (($is_collection_operation && $relay && $channel['channel_hash'] === $arr['owner_xchan']) ? $act->meta['original_id'] : $arr['mid']); + // Reactions such as like and dislike could have an mid with /activity/ in it. + // Check for both forms in order to prevent duplicates. + $r = q("select * from item where mid in ('%s', '%s') and uid = %d limit 1", dbesc($sql_mid), dbesc(reverse_activity_mid($sql_mid)), -- cgit v1.2.3