From 46bd4d71d045c6dd74373426e8758403bbe464d4 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 2 Dec 2023 06:19:30 +0000 Subject: [PATCH] Don't insert non public comments on not existing thread parents --- src/Protocol/ActivityPub/Processor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 47355a4cb9..d2a522e81b 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -1235,7 +1235,7 @@ class Processor $has_parents = false; - if (!empty($item['parent-uri-id'])) { + if (($item['private'] != Item::PRIVATE) && !empty($item['parent-uri-id'])) { if (Post::exists(['uri-id' => $item['parent-uri-id'], 'uid' => $receiver])) { $has_parents = true; } elseif ($add_parent && Post::exists(['uri-id' => $item['parent-uri-id'], 'uid' => 0])) { @@ -1254,7 +1254,7 @@ class Processor } } - if (empty($item['parent-uri-id']) || ($item['thr-parent-id'] != $item['parent-uri-id'])) { + if (($item['private'] == Item::PRIVATE) || empty($item['parent-uri-id']) || ($item['thr-parent-id'] != $item['parent-uri-id'])) { if (Post::exists(['uri-id' => $item['thr-parent-id'], 'uid' => $receiver])) { $has_parents = true; } elseif (($has_parents || $add_parent) && Post::exists(['uri-id' => $item['thr-parent-id'], 'uid' => 0])) {