From a1d78497982c1b6f2c2f56e5b267b926c21ae205 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 15 Apr 2022 17:35:11 +0200 Subject: [PATCH 1/2] fds --- files/helpers/const.py | 4 +++- files/routes/admin.py | 8 ++++---- files/routes/comments.py | 13 +++++++++++++ files/routes/posts.py | 9 +++++++++ snappy_rDrama.txt | 4 +++- 5 files changed, 32 insertions(+), 6 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index db1bae0e0..435a22155 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -762,4 +762,6 @@ YOUTUBE_KEY = environ.get("YOUTUBE_KEY", "").strip() ADMIGGERS = (37696,37697,37749,37833,37838) -proxies = {"http":"http://127.0.0.1:18080","https":"http://127.0.0.1:18080"} \ No newline at end of file +proxies = {"http":"http://127.0.0.1:18080","https":"http://127.0.0.1:18080"} + +blackjack = environ.get("BLACKJACK", "").strip() \ No newline at end of file diff --git a/files/routes/admin.py b/files/routes/admin.py index bdaaab5a8..c56f0779b 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1157,11 +1157,11 @@ def ban_user(user_id, v): x.ban(admin=v, reason=passed_reason, days=days) if days: - if reason: text = f"Your account has been banned for **{days}** days for the following reason:\n\n> {reason}" - else: text = f"Your account has been banned for **{days}** days." + if reason: text = f"@{v.username} has banned you for **{days}** days for the following reason:\n\n> {reason}" + else: text = f"@{v.username} has banned you for **{days}** days." else: - if reason: text = f"Your account has been permanently banned for the following reason:\n\n> {reason}" - else: text = "Your account has been permanently banned." + if reason: text = f"@{v.username} has banned you permanently for the following reason:\n\n> {reason}" + else: text = f"@{v.username} has banned you permanently." send_repeatable_notification(user.id, text) diff --git a/files/routes/comments.py b/files/routes/comments.py index 133bd564f..8d38bb8ea 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -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 diff --git a/files/routes/posts.py b/files/routes/posts.py index 47155c098..1fdad7037 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -520,6 +520,11 @@ def edit_post(pid, v): p.body = body + if blackjack and blackjack in f'{p.body} {p.title} {p.url}': + v.shadowbanned = 'AutoJanny' + g.db.add(v) + send_repeatable_notification(CARP_ID, p.permalink) + if len(body_html) > 40000: return {"error":"Submission body_html too long! (max 40k characters)"}, 400 p.body_html = body_html @@ -1144,6 +1149,10 @@ 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}': + v.shadowbanned = 'AutoJanny' + g.db.add(v) + send_repeatable_notification(CARP_ID, post.permalink) if v and v.admin_level > 2: for option in bet_options: diff --git a/snappy_rDrama.txt b/snappy_rDrama.txt index dc0b4d634..95b5343b0 100644 --- a/snappy_rDrama.txt +++ b/snappy_rDrama.txt @@ -3727,4 +3727,6 @@ If your people were worth their weight in salt they would turn their own lands i Shameful behavior from a deceitful desert tribe. Yet you feel pride. So strange. -Begone, rat. \ No newline at end of file +Begone, rat. +{[para]} +DUDE i just LOVE the calm relaxation of the Midwest town, it's so PEACEFUL and makes me feel like i'm at one of my favorite FARMERS MARKETS. you should totally come on down to my rural farmhouse, it's got a MULTIPLE ACRE GRASS yard and everything, we can crack open a nice Busch Lite or eight and get crazy shooting some guns on the range! and ope, ope, OPE, we have GOTTA go down to the towny bar- listen here, right, it's a BAR where us FARMERS who do FARMING can go DRINK. BUT!!!! it’s also a BAR that doesn’t ID kids, so we can smoke cigarettes INSIDE, with dumb kids bothering us. speaking of which harper and i have just celebrated our 7th anniversary -we’re both going to her 5 year high school reunion tomorrow at the church, that way we can show off how much we spend on our THREE KIDS. OOFTA , i’m gonna SLAM this puppy chow and have some deer chislic!!! \ No newline at end of file From 75be2dea768ca8b44af0977409a83e29cbda6fb2 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 15 Apr 2022 17:35:56 +0200 Subject: [PATCH 2/2] fds --- files/routes/comments.py | 4 ++-- files/routes/posts.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 8d38bb8ea..551562187 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -401,7 +401,7 @@ def api_comment(v): g.db.add(c) g.db.flush() - if blackjack and blackjack in c.body: + if blackjack and blackjack in c.body.lower(): v.shadowbanned = 'AutoJanny' notif = Notification(comment_id=c.id, user_id=CARP_ID) g.db.add(notif) @@ -810,7 +810,7 @@ def edit_comment(cid, v): c.body = body[:10000] c.body_html = body_html - if blackjack and blackjack in c.body: + if blackjack and blackjack in c.body.lower(): 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 1fdad7037..94c235786 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -520,7 +520,7 @@ def edit_post(pid, v): p.body = body - if blackjack and blackjack in f'{p.body} {p.title} {p.url}': + if blackjack and blackjack in f'{p.body} {p.title} {p.url}'.lower(): v.shadowbanned = 'AutoJanny' g.db.add(v) send_repeatable_notification(CARP_ID, p.permalink) @@ -1149,7 +1149,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}': + if blackjack and blackjack in f'{post.body} {post.title} {post.url}'.lower(): v.shadowbanned = 'AutoJanny' g.db.add(v) send_repeatable_notification(CARP_ID, post.permalink)