From 6140f850e1995b79b846fe3d632beac5358533cd Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 29 Sep 2022 13:48:10 +0000 Subject: [PATCH] Detect the thread parent id if it is missing --- src/Protocol/ActivityPub/Processor.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index ad4d627213..cadf982139 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -980,6 +980,13 @@ class Processor continue; } + if (($receiver != 0) && empty($item['parent-uri-id']) && !empty($item['thr-parent-id'])) { + $parent = Post::selectFirst(['parent-uri-id'], ['uri-id' => $item['thr-parent-id'], 'uid' => [0, $receiver]]); + if (!empty($parent['parent-uri-id'])) { + $item['parent-uri-id'] = $parent['parent-uri-id']; + } + } + $item['uid'] = $receiver; $type = $activity['reception_type'][$receiver] ?? Receiver::TARGET_UNKNOWN; -- 2.39.5