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 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)
|
||||||
|
|
|
@ -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'])
|
||||||
|
|
Loading…
Reference in New Issue