add missing ban_reason when shadowbanning
parent
dda49fdd70
commit
3bf62c6ff0
|
@ -83,6 +83,7 @@ def speak(data, v):
|
||||||
elif blackjack and any(i in text.lower() for i in blackjack.split()):
|
elif blackjack and any(i in text.lower() for i in blackjack.split()):
|
||||||
emit('speak', data)
|
emit('speak', data)
|
||||||
v.shadowbanned = 'AutoJanny'
|
v.shadowbanned = 'AutoJanny'
|
||||||
|
if not v.is_banned: v.ban_reason = 'Blackjack'
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
send_repeatable_notification(CARP_ID, f"{v.username} has been shadowbanned because of a chat message.")
|
send_repeatable_notification(CARP_ID, f"{v.username} has been shadowbanned because of a chat message.")
|
||||||
elif recipient:
|
elif recipient:
|
||||||
|
|
|
@ -327,6 +327,7 @@ def comment(v):
|
||||||
|
|
||||||
if blackjack and any(i in c.body.lower() for i in blackjack.split()):
|
if blackjack and any(i in c.body.lower() for i in blackjack.split()):
|
||||||
v.shadowbanned = 'AutoJanny'
|
v.shadowbanned = 'AutoJanny'
|
||||||
|
if not v.is_banned: v.ban_reason = 'Blackjack'
|
||||||
notif = Notification(comment_id=c.id, user_id=CARP_ID)
|
notif = Notification(comment_id=c.id, user_id=CARP_ID)
|
||||||
g.db.add(notif)
|
g.db.add(notif)
|
||||||
|
|
||||||
|
@ -692,6 +693,7 @@ def edit_comment(cid, v):
|
||||||
|
|
||||||
if blackjack and any(i in c.body.lower() for i in blackjack.split()):
|
if blackjack and any(i in c.body.lower() for i in blackjack.split()):
|
||||||
v.shadowbanned = 'AutoJanny'
|
v.shadowbanned = 'AutoJanny'
|
||||||
|
if not v.is_banned: v.ban_reason = 'Blackjack'
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=CARP_ID).one_or_none()
|
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=CARP_ID).one_or_none()
|
||||||
if not notif:
|
if not notif:
|
||||||
|
|
|
@ -86,9 +86,11 @@ def check_for_alts(current):
|
||||||
for u in current.alts_unique:
|
for u in current.alts_unique:
|
||||||
if u.shadowbanned:
|
if u.shadowbanned:
|
||||||
current.shadowbanned = u.shadowbanned
|
current.shadowbanned = u.shadowbanned
|
||||||
|
if not current.is_banned: current.ban_reason = u.ban_reason
|
||||||
g.db.add(current)
|
g.db.add(current)
|
||||||
elif current.shadowbanned:
|
elif current.shadowbanned:
|
||||||
u.shadowbanned = current.shadowbanned
|
u.shadowbanned = current.shadowbanned
|
||||||
|
if not u.is_banned: u.ban_reason = current.ban_reason
|
||||||
g.db.add(u)
|
g.db.add(u)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -437,6 +437,7 @@ def edit_post(pid, v):
|
||||||
|
|
||||||
if blackjack and any(i in f'{p.body} {p.title} {p.url}'.lower() for i in blackjack.split()):
|
if blackjack and any(i in f'{p.body} {p.title} {p.url}'.lower() for i in blackjack.split()):
|
||||||
v.shadowbanned = 'AutoJanny'
|
v.shadowbanned = 'AutoJanny'
|
||||||
|
if not v.is_banned: v.ban_reason = 'Blackjack'
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
send_repeatable_notification(CARP_ID, p.permalink)
|
send_repeatable_notification(CARP_ID, p.permalink)
|
||||||
|
|
||||||
|
@ -919,6 +920,7 @@ def submit_post(v, sub=None):
|
||||||
|
|
||||||
if blackjack and any(i in f'{post.body} {post.title} {post.url}'.lower() for i in blackjack.split()):
|
if blackjack and any(i in f'{post.body} {post.title} {post.url}'.lower() for i in blackjack.split()):
|
||||||
v.shadowbanned = 'AutoJanny'
|
v.shadowbanned = 'AutoJanny'
|
||||||
|
if not v.is_banned: v.ban_reason = 'Blackjack'
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
send_repeatable_notification(CARP_ID, post.permalink)
|
send_repeatable_notification(CARP_ID, post.permalink)
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ def flag_post(pid, v):
|
||||||
|
|
||||||
if blackjack and any(i in reason.lower() for i in blackjack.split()):
|
if blackjack and any(i in reason.lower() for i in blackjack.split()):
|
||||||
v.shadowbanned = 'AutoJanny'
|
v.shadowbanned = 'AutoJanny'
|
||||||
|
if not v.is_banned: v.ban_reason = 'Blackjack'
|
||||||
send_repeatable_notification(CARP_ID, f"reports on {post.permalink}")
|
send_repeatable_notification(CARP_ID, f"reports on {post.permalink}")
|
||||||
|
|
||||||
if v.is_muted:
|
if v.is_muted:
|
||||||
|
@ -127,6 +128,7 @@ def flag_comment(cid, v):
|
||||||
|
|
||||||
if blackjack and any(i in reason.lower() for i in blackjack.split()):
|
if blackjack and any(i in reason.lower() for i in blackjack.split()):
|
||||||
v.shadowbanned = 'AutoJanny'
|
v.shadowbanned = 'AutoJanny'
|
||||||
|
if not v.is_banned: v.ban_reason = 'Blackjack'
|
||||||
send_repeatable_notification(CARP_ID, f"reports on {comment.permalink}")
|
send_repeatable_notification(CARP_ID, f"reports on {comment.permalink}")
|
||||||
|
|
||||||
reason = reason[:100]
|
reason = reason[:100]
|
||||||
|
|
|
@ -772,6 +772,7 @@ def message2(v, username):
|
||||||
|
|
||||||
if blackjack and any(i in c.body_html.lower() for i in blackjack.split()):
|
if blackjack and any(i in c.body_html.lower() for i in blackjack.split()):
|
||||||
v.shadowbanned = 'AutoJanny'
|
v.shadowbanned = 'AutoJanny'
|
||||||
|
if not v.is_banned: v.ban_reason = 'Blackjack'
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=CARP_ID).one_or_none()
|
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=CARP_ID).one_or_none()
|
||||||
if not notif:
|
if not notif:
|
||||||
|
@ -847,6 +848,7 @@ def messagereply(v):
|
||||||
|
|
||||||
if blackjack and any(i in c.body_html.lower() for i in blackjack.split()):
|
if blackjack and any(i in c.body_html.lower() for i in blackjack.split()):
|
||||||
v.shadowbanned = 'AutoJanny'
|
v.shadowbanned = 'AutoJanny'
|
||||||
|
if not v.is_banned: v.ban_reason = 'Blackjack'
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=CARP_ID).one_or_none()
|
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=CARP_ID).one_or_none()
|
||||||
if not notif:
|
if not notif:
|
||||||
|
|
Loading…
Reference in New Issue