master
Aevann1 2021-09-14 19:35:24 +02:00
parent 0e28116652
commit ff7b6bc7a9
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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("/@<username>/info")
@auth_desired
def u_username_info(username, v=None):