removed unused

master
Aevann 2024-03-10 23:45:37 +02:00
parent 2027103d23
commit 6b2a71c4c6
1 changed files with 3 additions and 4 deletions

View File

@ -66,13 +66,12 @@ def private_chat(v, chat_id):
displayed_messages = reversed(g.db.query(ChatMessage).filter_by(chat_id=chat.id).order_by(ChatMessage.id.desc()).limit(250).all())
displayed_messages = {m.id: m for m in displayed_messages}
notifs_msgs = g.db.query(ChatNotification, ChatMessage).join(ChatNotification.chat_message).filter(
notifs = g.db.query(ChatNotification).filter(
ChatNotification.user_id == v.id,
ChatNotification.chat_id == chat.id,
).all()
for notif, msg in notifs_msgs:
msg.unread = True
g.db.delete(notif)
for n in notifs:
g.db.delete(n)
g.db.commit() #to clear notif count
return render_template("private_chat.html", v=v, messages=displayed_messages, chat=chat)