From b5b8b2927ce635bca8b15c785090526e96caaa59 Mon Sep 17 00:00:00 2001 From: TLSM Date: Sun, 13 Nov 2022 21:43:26 -0500 Subject: [PATCH] Expand blackjack handling pipeline. --- files/helpers/actions.py | 6 ++++++ files/routes/static.py | 1 + 2 files changed, 7 insertions(+) diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 89b51d757..a87638575 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -354,7 +354,11 @@ def execute_antispam_submission_check(title, v, url): return False return True +def execute_blackjack_custom(v, target, body, type): + return True + def execute_blackjack(v, target, body, type): + if not execute_blackjack_custom(v, target, body, type): return False if not blackjack or not body: return True if any(i in body.lower() for i in blackjack.split()): v.shadowbanned = 'AutoJanny' @@ -371,6 +375,8 @@ def execute_blackjack(v, target, body, type): extra_info = "chat message" elif type == 'flag': extra_info = f"reports on {target.permalink}" + elif type == 'modmail': + extra_info = "modmail" if notif: g.db.add(notif) diff --git a/files/routes/static.py b/files/routes/static.py index a361cd828..fdcf7d6fb 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -233,6 +233,7 @@ def submit_contact(v): ) g.db.add(new_comment) g.db.flush() + execute_blackjack(v, new_comment, new_comment.body_html, 'modmail') new_comment.top_comment_id = new_comment.id admins = g.db.query(User).filter(User.admin_level >= PERMS['NOTIFICATIONS_MODMAIL'])