fix unread attribute

remotes/1693045480750635534/spooky-22
Aevann1 2022-09-17 23:59:49 +02:00
parent dc6f4f8e10
commit d1e391683b
2 changed files with 2 additions and 4 deletions

View File

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

View File

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