Check early on and don't process ActivityPub items if we already have them and we are not updating them.

This commit is contained in:
Mike Macgirvin 2024-07-12 12:53:37 +10:00
parent 7539503fb0
commit a17733d732

View file

@ -4167,8 +4167,17 @@ class Activity
return;
}
// Save a lot of additional processing if we already have this item and we are not doing an update.
// Mastodon does not supply an updated timestamp on polls, so we have to process them regardless.
$check = q("select edited from item where mid = '%s' and uid = %d limit 1",
dbesc($item['mid']),
intval($channel['channel_id'])
);
if ($check && $check[0]['edited'] <= $item['edited'] && $item['obj_type'] !== 'Question') {
return;
}
$is_system = Channel::is_system($channel['channel_id']);
$is_child_node = false;
$commentApproval = null;