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")