From d026174472358274b261c423fa04ec4b636d2245 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 23 Apr 2022 00:48:01 +0200 Subject: [PATCH] fds --- files/routes/comments.py | 4 ++-- files/routes/posts.py | 4 ++-- files/routes/reporting.py | 4 ++-- files/routes/users.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 295b68a6d..cb0d898bf 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -393,7 +393,7 @@ def api_comment(v): g.db.add(c) g.db.flush() - if blackjack and blackjack in c.body.lower(): + 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) @@ -792,7 +792,7 @@ def edit_comment(cid, v): c.body = body[:10000] c.body_html = body_html - if blackjack and blackjack in c.body.lower(): + 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() diff --git a/files/routes/posts.py b/files/routes/posts.py index 5c67adb21..60b6c84cf 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -512,7 +512,7 @@ def edit_post(pid, v): p.body = body - if blackjack and blackjack in f'{p.body} {p.title} {p.url}'.lower(): + if blackjack and any(i in f'{p.body} {p.title} {p.url}'.lower() for i in blackjack.split()): v.shadowbanned = 'AutoJanny' g.db.add(v) send_repeatable_notification(CARP_ID, p.permalink) @@ -1137,7 +1137,7 @@ def submit_post(v, sub=None): g.db.add(post) g.db.flush() - if blackjack and blackjack in f'{post.body} {post.title} {post.url}'.lower(): + if blackjack and any(i in f'{post.body} {post.title} {post.url}'.lower() for i in blackjack.split()): v.shadowbanned = 'AutoJanny' g.db.add(v) send_repeatable_notification(CARP_ID, post.permalink) diff --git a/files/routes/reporting.py b/files/routes/reporting.py index d6ee04267..f4a1cbbc3 100644 --- a/files/routes/reporting.py +++ b/files/routes/reporting.py @@ -14,7 +14,7 @@ def api_flag_post(pid, v): reason = request.values.get("reason", "").strip() - if blackjack and blackjack in reason.lower(): + if blackjack and any(i in reason.lower() for i in blackjack.split()): v.shadowbanned = 'AutoJanny' send_repeatable_notification(CARP_ID, f"reports on {post.permalink}") @@ -68,7 +68,7 @@ def api_flag_comment(cid, v): reason = request.values.get("reason", "").strip() - if blackjack and blackjack in reason.lower(): + if blackjack and any(i in reason.lower() for i in blackjack.split()): v.shadowbanned = 'AutoJanny' send_repeatable_notification(CARP_ID, f"reports on {comment.permalink}") diff --git a/files/routes/users.py b/files/routes/users.py index c21bbda72..918346ad2 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -625,7 +625,7 @@ def message2(v, username): g.db.flush() - if blackjack and blackjack in c.body_html.lower(): + if blackjack and any(i in c.body_html.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() @@ -703,7 +703,7 @@ def messagereply(v): g.db.add(c) g.db.flush() - if blackjack and blackjack in c.body_html.lower(): + if blackjack and any(i in c.body_html.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()