This commit is contained in:
Aevann1 2022-01-17 13:06:12 +02:00
parent ef4a414275
commit 47d19b5b4e
12 changed files with 44 additions and 40 deletions

View file

@ -435,8 +435,9 @@ def message2(v, username):
g.db.add(notif)
if len(message) > 500: notifbody = message[:500] + '...'
else: notifbody = message
elif message: notifbody = message
else: notifbody = ''
beams_client.publish_to_interests(
interests=[f'{request.host}{user.id}'],
publish_body={
@ -502,7 +503,8 @@ def messagereply(v):
g.db.add(notif)
if len(message) > 500: notifbody = message[:500] + '...'
else: notifbody = message
elif message: notifbody = message
else: notifbody = ''
beams_client.publish_to_interests(
interests=[f'{request.host}{user_id}'],
@ -628,7 +630,7 @@ def u_username(username, v=None):
if username != u.username:
return redirect(request.path.replace(username, u.username))
return redirect(request.full_path.replace(username, u.username))
if u.reserved:
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": f"That username is reserved for: {u.reserved}"}
@ -796,7 +798,7 @@ def u_username_comments(username, v=None):
elif sort == "controversial":
comments = comments.order_by(-1 * Comment.upvotes * Comment.downvotes * Comment.downvotes)
elif sort == "top":
comments = comments.order_by(Comment.realupvotes.desc())
comments = comments.order_by(Comment.downvotes - Comment.upvotes)
elif sort == "bottom":
comments = comments.order_by(Comment.upvotes - Comment.downvotes)