From 3a6481f3dae82b2da14f242eee61f6791274cfdf Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 24 Jun 2023 16:37:08 +0300 Subject: [PATCH] allow ppl to search their own ghost comments --- files/routes/search.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/routes/search.py b/files/routes/search.py index bd3a21141..50ba080dc 100644 --- a/files/routes/search.py +++ b/files/routes/search.py @@ -73,8 +73,9 @@ def searchposts(v:User): Post.private == False) if 'author' in criteria: - posts = posts.filter(Post.ghost == False) author = get_user(criteria['author'], v=v) + if author.id != v.id: + posts = posts.filter(Post.ghost == False) if not author.is_visible_to(v): if v.client: abort(403, f"@{author.username}'s profile is private; You can't use the 'author' syntax on them") @@ -211,8 +212,9 @@ def searchcomments(v:User): if 'author' in criteria: - comments = comments.filter(Comment.ghost == False) author = get_user(criteria['author'], v=v) + if author.id != v.id: + comments = comments.filter(Comment.ghost == False) if not author.is_visible_to(v): if v.client: abort(403, f"@{author.username}'s profile is private; You can't use the 'author' syntax on them")