aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Activity.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-03-11 20:29:18 +0000
committerMario <mario@mariovavti.com>2022-03-11 20:29:18 +0000
commit4ffd7587a953fa1389326138c37297f046dae155 (patch)
treee48865d69916acceef5af5173f6496f664a3678a /Zotlabs/Lib/Activity.php
parentc48c62c7a8e8b4d45bbc68a1b2eaf6efd19e6566 (diff)
downloadvolse-hubzilla-4ffd7587a953fa1389326138c37297f046dae155.tar.gz
volse-hubzilla-4ffd7587a953fa1389326138c37297f046dae155.tar.bz2
volse-hubzilla-4ffd7587a953fa1389326138c37297f046dae155.zip
make sure an announce does not overwrite an item we already have and make sure it will be a toplevel post
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r--Zotlabs/Lib/Activity.php7
1 files changed, 7 insertions, 0 deletions
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);