federated delete issue

This commit is contained in:
Mike Macgirvin 2024-02-28 06:04:39 +11:00
parent d3520a04b9
commit 8fb88db87b

View file

@ -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');