From c7467c4ba6a7a5339b5859b756be736773dcd596 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Sat, 22 Jun 2024 14:39:41 +1000 Subject: [PATCH] cleanup inspect - don't use jindent --- src/Lib/Activity.php | 1 + src/Module/Inspect.php | 4 ++-- src/Module/Replies.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Lib/Activity.php b/src/Lib/Activity.php index 9a7c582fe..be850a4ab 100644 --- a/src/Lib/Activity.php +++ b/src/Lib/Activity.php @@ -1192,6 +1192,7 @@ class Activity $activity['to'] = [ACTIVITY_PUBLIC_INBOX]; return $activity; } + $activity['replies'] = z_root() . '/replies/' . basename($item['mid']); if (isset($item['obj']) && $item['obj']) { if (is_string($item['obj'])) { diff --git a/src/Module/Inspect.php b/src/Module/Inspect.php index 91484147e..23d4b43cb 100644 --- a/src/Module/Inspect.php +++ b/src/Module/Inspect.php @@ -62,8 +62,8 @@ class Inspect extends Controller $output .= '(encode_activity)' . EOL . '
' . escape_tags(json_encode(Activity::encode_activity($item, true),
                         JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)) . '
' . EOL . EOL; - - $output .= '(cached activity)' . EOL . '
' . jindent(escape_tags(ObjCache::Get($item['mid']) ?? '')) . '
' . EOL . EOL; + + $output .= '(cached activity)' . EOL . '
' . jindent(json_encode(json_decode(ObjCache::Get($item['mid']) ?? '', true),JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)) . '
' . EOL . EOL; if (str_contains($item['tgt_type'], 'Collection') && !empty($item['target']['id'])) { $str = Activity::fetch($item['target']['id'], App::$channel); diff --git a/src/Module/Replies.php b/src/Module/Replies.php index 4b2350c8b..0e2c50ad5 100644 --- a/src/Module/Replies.php +++ b/src/Module/Replies.php @@ -99,7 +99,7 @@ class Replies extends Controller $sql_noAdd = " and verb not in ('Add', 'Remove') "; $items = q( - "SELECT item.*, item.id AS item_id FROM item WHERE item.thr_parent = '%s' $item_normal $sql_noAdd and item_private = %d and item_deleted = 0 and uid = %d", + "SELECT item.*, item.id AS item_id FROM item WHERE item.thr_parent = '%s' and item.mid != item.parent_mid $item_normal $sql_noAdd and item_private = %d and item_deleted = 0 and uid = %d", dbesc($i[0]['mid']), intval($i[0]['item_private']), intval($i[0]['uid'])