Expand blackjack handling pipeline.

master
Snakes 2022-11-13 21:43:26 -05:00
parent 6169c02c89
commit b5b8b2927c
Signed by: Snakes
GPG Key ID: E745A82778055C7E
2 changed files with 7 additions and 0 deletions

View File

@ -354,7 +354,11 @@ def execute_antispam_submission_check(title, v, url):
return False return False
return True return True
def execute_blackjack_custom(v, target, body, type):
return True
def execute_blackjack(v, target, body, type): 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 not blackjack or not body: return True
if any(i in body.lower() for i in blackjack.split()): if any(i in body.lower() for i in blackjack.split()):
v.shadowbanned = 'AutoJanny' v.shadowbanned = 'AutoJanny'
@ -371,6 +375,8 @@ def execute_blackjack(v, target, body, type):
extra_info = "chat message" extra_info = "chat message"
elif type == 'flag': elif type == 'flag':
extra_info = f"reports on {target.permalink}" extra_info = f"reports on {target.permalink}"
elif type == 'modmail':
extra_info = "modmail"
if notif: if notif:
g.db.add(notif) g.db.add(notif)

View File

@ -233,6 +233,7 @@ def submit_contact(v):
) )
g.db.add(new_comment) g.db.add(new_comment)
g.db.flush() g.db.flush()
execute_blackjack(v, new_comment, new_comment.body_html, 'modmail')
new_comment.top_comment_id = new_comment.id new_comment.top_comment_id = new_comment.id
admins = g.db.query(User).filter(User.admin_level >= PERMS['NOTIFICATIONS_MODMAIL']) admins = g.db.query(User).filter(User.admin_level >= PERMS['NOTIFICATIONS_MODMAIL'])