From 6b96c284e4822f716e7f807987a3543569946556 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 21 Feb 2022 05:16:57 +0200 Subject: [PATCH] vc --- files/routes/users.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/files/routes/users.py b/files/routes/users.py index 7b016f41e..a755a3d77 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -539,7 +539,8 @@ def messagereply(v): parent = get_comment(id, v=v) user_id = parent.author.id - if v.id == user_id: user_id = parent.sentto + if parent.sentto == 2: user_id = None + elif v.id == user_id: user_id = parent.sentto text_html = sanitize(message, noimages=True) @@ -554,7 +555,7 @@ def messagereply(v): g.db.add(new_comment) g.db.flush() - if user_id != v.id and user_id != 0: + if user_id and user_id != v.id and user_id != 2: notif = Notification(comment_id=new_comment.id, user_id=user_id) g.db.add(notif) @@ -587,7 +588,7 @@ def messagereply(v): if new_comment.top_comment.sentto == 2: - admins = g.db.query(User).filter(User.admin_level > 2, User.id != v.id, User.id != user_id).all() + admins = g.db.query(User).filter(User.admin_level > 2, User.id != v.id).all() for admin in admins: notif = Notification(comment_id=new_comment.id, user_id=admin.id) g.db.add(notif)