From 8fb88db87b991a9e493240fc01d04b582640327e Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Wed, 28 Feb 2024 06:04:39 +1100 Subject: [PATCH] federated delete issue --- Code/Lib/ActivityPub.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Code/Lib/ActivityPub.php b/Code/Lib/ActivityPub.php index 297362428..cca0f9e44 100644 --- a/Code/Lib/ActivityPub.php +++ b/Code/Lib/ActivityPub.php @@ -38,20 +38,14 @@ class ActivityPub return; } - // Use a cached copy if available, except in the case where we just edited a post. - // Then ignore the cached copy. + // Use a cached copy if available, except in the case where we just edited + // or deleted a post. In these cases ignore the cached copy and create a fresh activity. - if ($arr['cmd'] !== 'edit_post') { + if (!$arr['target_item']['item_deleted'] && !$arr['target_item']['verb'] === 'Update') { $signed_msg = ObjCache::Get($arr['target_item']['mid']); } - - // If we have an activity already stored with an LD-signature - // which we are sending downstream, use that signed activity as is. - // The channel will then sign the HTTP transaction. - - // It is unclear if Mastodon supports the federation delivery model. Initial tests were - // inconclusive and the behaviour varied. + // If we are relaying the activity, we must have a signed activity. if (($arr['channel']['channel_hash'] !== $arr['target_item']['author_xchan']) && (!$signed_msg)) { logger('relayed post with no signed message');