From b50da2d8b783745d2dde3e82c5809effafd9b7d5 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 15 May 2023 08:03:27 +0000 Subject: fix parent_mid and thr_parent not set correctly for response activities --- Zotlabs/Lib/Activity.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Lib/Activity.php') diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index bb3695341..fcf3fb172 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -2304,9 +2304,18 @@ class Activity { $response_activity = true; $s['mid'] = $act->id; - $s['uuid'] = (($act->data['diaspora:guid']) ?: uuid_from_url($s['mid'])); + $s['uuid'] = ((!empty($act->data['diaspora:guid'])) ? $act->data['diaspora:guid'] : uuid_from_url($s['mid'])); - $s['parent_mid'] = $act->objprop('id') ?: $act->obj; + if ($act->objprop('inReplyTo')) { + $s['parent_mid'] = $act->objprop('inReplyTo'); + } + + $s['thr_parent'] = $act->objprop('id') ?: $act->obj; + + if (empty($s['parent_mid']) || empty($s['thr_parent'])) { + logger('response activity without parent_mid or thr_parent'); + return; + } // over-ride the object timestamp with the activity @@ -2844,7 +2853,6 @@ class Activity { ]; call_hooks('decode_note', $hookinfo); - return $hookinfo['s']; } @@ -3092,6 +3100,7 @@ class Activity { return; } +/* if ($parent[0]['parent_mid'] !== $item['parent_mid']) { $item['thr_parent'] = $item['parent_mid']; } @@ -3099,6 +3108,7 @@ class Activity { $item['thr_parent'] = $parent[0]['parent_mid']; } $item['parent_mid'] = $parent[0]['parent_mid']; +*/ /* * -- cgit v1.2.3