From ff7b6bc7a9be86de16cc71b972bf2b04f6265e45 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 14 Sep 2021 19:35:24 +0200 Subject: [PATCH] fd --- files/helpers/get.py | 4 ++-- files/routes/users.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/files/helpers/get.py b/files/helpers/get.py index b741dbbc1..e143b96d9 100644 --- a/files/helpers/get.py +++ b/files/helpers/get.py @@ -192,7 +192,7 @@ def get_comment(i, v=None, graceful=False, **kwargs): return comment -def get_comments(cids, v=None, load_parent=False): +def get_comments(cids, v=None, load_parent=False, shadowbanned=False): if not cids: return [] @@ -229,7 +229,7 @@ def get_comments(cids, v=None, load_parent=False): output = [] for c in comments: comment = c[0] - if comment.author and comment.author.shadowbanned and not (v and v.id == comment.author_id): continue + if comment.author and comment.author.shadowbanned and v.id != comment.author_id and not (shadowbanned and v.admin_level==6): continue comment.voted = c[1] or 0 comment._is_blocking = c[2] or 0 comment._is_blocked = c[3] or 0 diff --git a/files/routes/users.py b/files/routes/users.py index e65ef535c..a1ee425c5 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -553,13 +553,14 @@ def u_username_comments(username, v=None): next_exists = (len(ids) > 25) ids = ids[:25] - listing = get_comments(ids, v=v) + listing = get_comments(ids, v=v, shadowbanned=True) is_following = (v and user.has_follower(v)) if request.headers.get("Authorization"): return {"data": [c.json for c in listing]} else: return render_template("userpage_comments.html", u=user, v=v, listing=listing, page=page, sort=sort, t=t,next_exists=next_exists, is_following=is_following, standalone=True) + @app.get("/@/info") @auth_desired def u_username_info(username, v=None):