forked from MarseyWorld/MarseyWorld
Expand blackjack handling pipeline.
parent
6169c02c89
commit
b5b8b2927c
|
@ -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)
|
||||
|
|
|
@ -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'])
|
||||
|
|
Loading…
Reference in New Issue