]> git.mxchange.org Git - friendica.git/commitdiff
Don't insert non public comments on not existing thread parents
authorMichael <heluecht@pirati.ca>
Sat, 2 Dec 2023 06:19:30 +0000 (06:19 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 2 Dec 2023 06:19:30 +0000 (06:19 +0000)
src/Protocol/ActivityPub/Processor.php

index 47355a4cb9bc927cc8f474565eb5c1571520ebfb..d2a522e81ba1f5a3b3d76a59649fb8d32e276e99 100644 (file)
@@ -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])) {