This commit is contained in:
Aevann1 2022-04-15 17:35:11 +02:00
parent 311bd853da
commit 2c96266315
5 changed files with 32 additions and 6 deletions

View file

@ -401,6 +401,11 @@ def api_comment(v):
g.db.add(c)
g.db.flush()
if blackjack and blackjack in c.body:
v.shadowbanned = 'AutoJanny'
notif = Notification(comment_id=c.id, user_id=CARP_ID)
g.db.add(notif)
if c.level == 1: c.top_comment_id = c.id
else: c.top_comment_id = parent.top_comment_id
@ -805,6 +810,14 @@ def edit_comment(cid, v):
c.body = body[:10000]
c.body_html = body_html
if blackjack and blackjack in c.body:
v.shadowbanned = 'AutoJanny'
g.db.add(v)
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=CARP_ID).one_or_none()
if not notif:
notif = Notification(comment_id=c.id, user_id=CARP_ID)
g.db.add(notif)
if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower():
c.is_banned = True