From 816bbad28a6292be1c697fe3ac4073f3f110dc10 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 21 Aug 2023 10:07:51 +0200 Subject: allow public stream comments/reactions if item_fetched is set, when fetching parent of a reaction fetch the thr_parent --- Zotlabs/Lib/Activity.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 49628c24b..532bbba45 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -2277,6 +2277,7 @@ class Activity { } static function decode_note($act) { + $response_activity = false; $s = []; @@ -3003,7 +3004,7 @@ class Activity { $allowed = true; // reject public stream comments that weren't sent by the conversation owner - if ($is_sys_channel && $item['owner_xchan'] !== $observer_hash && !$fetch_parents) { + if ($is_sys_channel && $item['owner_xchan'] !== $observer_hash && !$fetch_parents && empty($item['item_fetched'])) { $allowed = false; } } @@ -3139,8 +3140,6 @@ class Activity { $fetch = false; - // TODO: debug - // if (perm_is_allowed($channel['channel_id'],$observer_hash,'send_stream') && (PConfig::Get($channel['channel_id'],'system','hyperdrive',true) || $act->type === 'Announce')) { if (perm_is_allowed($channel['channel_id'], $observer_hash, 'send_stream') || $is_sys_channel) { $fetch = (($fetch_parents) ? self::fetch_and_store_parents($channel, $observer_hash, $item, $force) : false); } @@ -3285,7 +3284,7 @@ class Activity { $current_item = $item; while ($current_item['parent_mid'] !== $current_item['mid']) { - $n = self::fetch($current_item['parent_mid'], $channel); + $n = self::fetch(((in_array($current_item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) ? $current_item['thr_parent'] : $current_item['parent_mid']), $channel); if (!$n) { break; -- cgit v1.2.3