From 4ffd7587a953fa1389326138c37297f046dae155 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 11 Mar 2022 20:29:18 +0000 Subject: make sure an announce does not overwrite an item we already have and make sure it will be a toplevel post --- Zotlabs/Lib/Activity.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Zotlabs/Lib/Activity.php') diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index f0e2bc805..0c25605e7 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -2376,6 +2376,7 @@ class Activity { if ($act->type === 'Announce') { $s['author_xchan'] = $obj_actor['id']; $s['mid'] = $act->obj['id']; + $s['parent_mid'] = $act->obj['id']; } if ($act->type === 'emojiReaction') { $content['content'] = (($act->tgt && $act->tgt['type'] === 'Image') ? '[img=32x32]' . $act->tgt['url'] . '[/img]' : '&#x' . $act->tgt['name'] . ';'); @@ -3143,6 +3144,12 @@ class Activity { intval($item['uid']) ); if ($r) { + + // If we already have the item, dismiss its announce + if ($act->type === 'Announce') { + return; + } + if ($item['edited'] > $r[0]['edited']) { $item['id'] = $r[0]['id']; $x = item_store_update($item); -- cgit v1.2.3