forked from rDrama/rDrama
fix unread attribute
parent
dc6f4f8e10
commit
d1e391683b
|
@ -111,9 +111,11 @@ def notifications_messages(v):
|
|||
next_exists = (len(message_threads) > 25)
|
||||
listing = message_threads[:25]
|
||||
|
||||
list_to_perserve_unread_attribute = []
|
||||
comments_unread = g.db.query(Comment).filter(Comment.id.in_(notifs_unread))
|
||||
for c in comments_unread:
|
||||
c.unread = True
|
||||
list_to_perserve_unread_attribute.append(c)
|
||||
|
||||
if request.headers.get("Authorization"): return {"data":[x.json for x in listing]}
|
||||
|
||||
|
|
|
@ -810,10 +810,6 @@ def messagereply(v):
|
|||
if not notif:
|
||||
notif = Notification(comment_id=c.id, user_id=user_id)
|
||||
g.db.add(notif)
|
||||
ids = [c.top_comment.id] + [x.id for x in c.top_comment.replies(None)]
|
||||
notifications = g.db.query(Notification).filter(Notification.comment_id.in_(ids), Notification.user_id == user_id)
|
||||
for n in notifications:
|
||||
g.db.delete(n)
|
||||
|
||||
if PUSHER_ID != 'blahblahblah' and not v.shadowbanned:
|
||||
interests = f'{SITE}{user_id}'
|
||||
|
|
Loading…
Reference in New Issue