From 6b63514d8ecb3fc969dddb40b74fa7af06f7672f Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 18 Nov 2023 15:20:21 +0200 Subject: [PATCH] make report notifs not work when sent by muted person --- files/routes/reporting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/reporting.py b/files/routes/reporting.py index ff483a5f1..4e408e59d 100644 --- a/files/routes/reporting.py +++ b/files/routes/reporting.py @@ -67,7 +67,7 @@ def report_post(pid, v): report = Report(post_id=post.id, user_id=v.id, reason=reason_html) g.db.add(report) - if v.id != post.author_id and not post.author.has_blocked(v): + if v.id != post.author_id and not post.author.has_blocked(v) and not post.author.has_muted(v): message = f'@{v.username} reported [{post.title}]({post.shortlink})\n\n> {reason}' send_repeatable_notification(post.author_id, message) @@ -99,7 +99,7 @@ def report_comment(cid, v): report = CommentReport(comment_id=comment.id, user_id=v.id, reason=reason_html) g.db.add(report) - if v.id != comment.author_id and not comment.author.has_blocked(v): + if v.id != comment.author_id and not comment.author.has_blocked(v) and not comment.author.has_muted(v): message = f'@{v.username} reported your [comment]({comment.shortlink})\n\n> {reason}' send_repeatable_notification(comment.author_id, message)