diff --git a/files/routes/comments.py b/files/routes/comments.py index d47cbdd59..b23c2c8d9 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -325,6 +325,11 @@ def comment(v): g.db.add(c) g.db.flush() + if blackjack and any(i in c.body.lower() for i in blackjack.split()): + 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 @@ -684,6 +689,14 @@ def edit_comment(cid, v): c.body = body[:10000] c.body_html = body_html + if blackjack and any(i in c.body.lower() for i in blackjack.split()): + 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() and c.post.sub != 'chudrama': return {"error": f'You have to include "{AGENDAPOSTER_PHRASE}" in your comment!'}, 403