From 024c532bb3f4277857e298046ec73e864c83e9bf Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 1 Sep 2023 10:51:20 +0300 Subject: [PATCH] dont notify ppl when someone they blocked replies to them --- files/routes/comments.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index a0659df00c..7540cf5fa0 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -172,12 +172,15 @@ def comment(v): elif v.bird and len(body) > 140: abort(403, "You have to type less than 140 characters!") - if not body and not request.files.get('file'): abort(400, "You need to actually write something!") + if not body and not request.files.get('file'): + abort(400, "You need to actually write something!") + + if parent_user.has_blocked(v): + notify_op = False if request.files.get("file") and not g.is_tor: files = request.files.getlist('file')[:20] - if files: media_ratelimit(v) @@ -367,7 +370,7 @@ def comment(v): n = Notification(comment_id=c.id, user_id=x) g.db.add(n) - if parent_user.id != v.id: + if parent_user.id != v.id and notify_op: if isinstance(parent, User): title = f"New comment on your wall by @{c.author_name}" else: