From fcba426009ca0f038c28f15c730cc7db9980efe4 Mon Sep 17 00:00:00 2001 From: FatherInire <105288522+FatherInire@users.noreply.github.com> Date: Sun, 22 May 2022 12:43:00 +1000 Subject: [PATCH] Remove some gimmicky r/drama features. Co-authored-by: Inire <> --- files/assets/css/main.css | 4 +- files/classes/badges.py | 6 +- files/classes/comment.py | 3 +- files/classes/flags.py | 4 +- files/classes/mod_logs.py | 10 --- files/classes/submission.py | 8 -- files/classes/user.py | 3 +- files/helpers/const.py | 99 +------------------------ files/helpers/jinja2.py | 2 +- files/routes/admin.py | 74 ------------------ files/routes/awards.py | 24 ------ files/routes/chat.py | 2 +- files/routes/comments.py | 84 ++------------------- files/routes/front.py | 8 -- files/routes/posts.py | 96 +----------------------- files/routes/settings.py | 2 - files/routes/users.py | 6 -- files/routes/votes.py | 4 +- files/templates/admin/admin_home.html | 1 - files/templates/authforms.html | 20 +---- files/templates/comments.html | 2 +- files/templates/default.html | 20 +---- files/templates/log.html | 20 +---- files/templates/settings.html | 20 +---- files/templates/submission.html | 6 +- files/templates/submission_listing.html | 4 +- files/templates/submit.html | 20 +---- files/templates/userpage.html | 16 ---- 28 files changed, 29 insertions(+), 539 deletions(-) diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 07f8f4780..642264f52 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -4625,9 +4625,7 @@ img[pat][src^="/pp/"], img[pat][src$="/pic"] { color: #f27d0c !important; font-weight: 800; } -.agendaposter { - text-transform: uppercase !important; -} + code { text-transform: none !important; } diff --git a/files/classes/badges.py b/files/classes/badges.py index e25700b3e..6464d5d3a 100644 --- a/files/classes/badges.py +++ b/files/classes/badges.py @@ -40,11 +40,7 @@ class Badge(Base): @property @lazy def text(self): - if self.name == "Chud": - ti = self.user.agendaposter - if ti: text = self.badge.description + " until " + datetime.utcfromtimestamp(ti).strftime('%Y-%m-%d %H:%M:%S') - else: text = self.badge.description + " permanently" - elif self.badge_id in {94,95,96,97,98,109}: + if self.badge_id in {94,95,96,97,98,109}: if self.badge_id == 94: ti = self.user.progressivestack elif self.badge_id == 95: ti = self.user.bird elif self.badge_id == 96: ti = self.user.flairchanged diff --git a/files/classes/comment.py b/files/classes/comment.py index 1d5cbbeed..d202cdc59 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -357,7 +357,6 @@ class Comment(Base): body = self.body_html or "" if body: - body = censor_slurs(body, v) if v: body = body.replace("old.reddit.com", v.reddit) @@ -423,7 +422,7 @@ class Comment(Base): if not body: return "" - return censor_slurs(body, v) + return body def print(self): print(f'post: {self.id}, comment: {self.author_id}', flush=True) diff --git a/files/classes/flags.py b/files/classes/flags.py index 27401bad3..e8d64d462 100644 --- a/files/classes/flags.py +++ b/files/classes/flags.py @@ -37,7 +37,7 @@ class Flag(Base): @lazy def realreason(self, v): - return censor_slurs(self.reason, v) + return self.reason class CommentFlag(Base): @@ -72,4 +72,4 @@ class CommentFlag(Base): @lazy def realreason(self, v): - return censor_slurs(self.reason, v) + return self.reason diff --git a/files/classes/mod_logs.py b/files/classes/mod_logs.py index 97c8df133..773028995 100644 --- a/files/classes/mod_logs.py +++ b/files/classes/mod_logs.py @@ -116,11 +116,6 @@ class ModAction(Base): return f"/log/{self.id}" ACTIONTYPES = { - 'agendaposter': { - "str": 'set chud theme on {self.target_link}', - "icon": 'fa-snooze', - "color": 'bg-danger' - }, 'approve_app': { "str": 'approved an application by {self.target_link}', "icon": 'fa-robot', @@ -356,11 +351,6 @@ ACTIONTYPES = { "icon": 'fa-eye-slash', "color": 'bg-danger' }, - 'unagendaposter': { - "str": 'removed chud theme from {self.target_link}', - "icon": 'fa-snooze', - "color": 'bg-success' - }, 'unban_comment': { "str": 'reinstated {self.target_link}', "icon": 'fa-comment', diff --git a/files/classes/submission.py b/files/classes/submission.py index 3fd9e532e..6e9c10f1d 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -381,8 +381,6 @@ class Submission(Base): body = self.body_html or "" - body = censor_slurs(body, v) - if v: body = body.replace("old.reddit.com", v.reddit) @@ -447,8 +445,6 @@ class Submission(Base): if not body: return "" - body = censor_slurs(body, v) - if v: body = body.replace("old.reddit.com", v.reddit) @@ -468,8 +464,6 @@ class Submission(Base): elif self.title_html: title = self.title_html else: title = self.title - title = censor_slurs(title, v) - return title @lazy @@ -479,8 +473,6 @@ class Submission(Base): else: return f'{CC} MEMBERS ONLY' else: title = self.title - title = censor_slurs(title, v) - return title @property diff --git a/files/classes/user.py b/files/classes/user.py index 1d044b687..6f6a97b32 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -520,8 +520,7 @@ class User(Base): @property @lazy def profile_url(self): - if self.agendaposter: return f"{SITE_FULL}/assets/images/astolfo.webp?v=1" - if self.profileurl: + if self.profileurl: if self.profileurl.startswith('/'): return SITE_FULL + self.profileurl return self.profileurl return f"{SITE_FULL}/assets/images/default-profile-pic.webp?v=1008" diff --git a/files/helpers/const.py b/files/helpers/const.py index 9b3c539ae..f1310a55b 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -28,76 +28,11 @@ AJ_REPLACEMENTS = { } SLURS = { - "retarded": "r-slurred", - "retard": "r-slur", - "gayfag": "gaystrag", - "poorfag": "poorstrag", - "richfag": "richstrag", - "newfag": "newstrag", - "oldfag": "oldstrag", - "faggotry": "cute twinkry", - "faggot": "cute twink", - "pedophile": "libertarian", - "kill yourself": "keep yourself safe", - "n1gger": "BIPOC", - "nlgger": "BIPOC", - "nigger": "BIPOC", - "steve akins": "penny verity oaken", - "trannie": "🚂🚃🚃", - "tranny": "🚂🚃🚃", - "troon": "🚂🚃🚃", - "nonewnormal": "HorseDewormerAddicts", - "kikery": "https://sciencedirect.com/science/article/abs/pii/S016028960600033X", - "kike": "https://sciencedirect.com/science/article/abs/pii/S016028960600033X", - "latinos": "latinx", - "latino": "latinx", - "latinas": "latinx", - "latina": "latinx", - "hispanics": "latinx", - "hispanic": "latinx", - "uss liberty incident": "tragic accident aboard the USS Liberty", - "lavon affair": "Lavon Misunderstanding", - "shylock": "Israeli friend", - "mohammad": "Prophet Mohammad (PBUH)", - "muhammad": "Prophet Mohammad (PBUH)", - "i hate marsey": "i love marsey", - "dancing israelis": "i love Israel", - "sodomite": "total dreamboat", - "pajeet": "sexy Indian dude", - "landlord": "landchad", - "tenant": "renthog", - "renter": "rentoid", - "autistic": "neurodivergent", - "holohoax": "i tried to claim the Holocaust didn't happen because I am a pencil-dicked imbecile and the word filter caught me lol", - "groomercord": "discord (actually a pretty cool service)", - "pedocord": "discord (actually a pretty cool service)", - "i hate carp": "i love Carp", - "manlet": "little king", - "gamer": "g*mer", - "journalist": "journ*list", - "journalism": "journ*lism", - "wuhan flu": "SARS-CoV-2 syndemic", - "china flu": "SARS-CoV-2 syndemic", - "china virus": "SARS-CoV-2 syndemic", - "kung flu": "SARS-CoV-2 syndemic", - "elon musk": "rocket daddy", - "fake and gay": "fake and straight", - - " rapist ": " male feminist ", - " pedo ": " libertarian ", - " kys ": " keep yourself safe ", - " fag ": " cute twink ", } single_words = "|".join([slur.lower() for slur in SLURS.keys()]) -LONGPOST_REPLIES = ('Wow, you must be a JP fan.', 'This is one of the worst posts I have EVER seen. Delete it.', "No, don't reply like this, please do another wall of unhinged rant please.", '# 😴😴😴', "Ma'am we've been over this before. You need to stop.", "I've known more coherent downies.", "Your pulitzer's in the mail", "That's great and all, but I asked for my burger without cheese.", 'That degree finally paying off', "That's nice sweaty. Why don't you have a seat in the time out corner with Pizzashill until you calm down, then you can have your Capri Sun.", "All them words won't bring your pa back.", "You had a chance to not be completely worthless, but it looks like you threw it away. At least you're consistent.", 'Some people are able to display their intelligence by going on at length on a subject and never actually saying anything. This ability is most common in trades such as politics, public relations, and law. You have impressed me by being able to best them all, while still coming off as an absolute idiot.', "You can type 10,000 characters and you decided that these were the one's that you wanted.", 'Have you owned the libs yet?', "I don't know what you said, because I've seen another human naked.", 'Impressive. Normally people with such severe developmental disabilities struggle to write much more than a sentence or two. He really has exceded our expectations for the writing portion. Sadly the coherency of his writing, along with his abilities in the social skills and reading portions, are far behind his peers with similar disabilities.', "This is a really long way of saying you don't fuck.", "Sorry ma'am, looks like his delusions have gotten worse. We'll have to admit him.", ':#marseywoah:', 'If only you could put that energy into your relationships', 'Posts like this is why I do Heroine.', 'still unemployed then?', 'K', 'look im gunna have 2 ask u 2 keep ur giant dumps in the toilet not in my replys 😷😷😷', "Mommy is soooo proud of you, sweaty. Let's put this sperg out up on the fridge with all your other failures.", "Good job bobby, here's a star", "That was a mistake. You're about to find out the hard way why.", f'You sat down and wrote all this shit. You could have done so many other things with your life. What happened to your life that made you decide writing novels of bullshit on {SITE} was the best option?', "I don't have enough spoons to read this shit", "All those words won't bring daddy back.", 'OUT!', "Damn, you're really mad over this, but thanks for the effort you put into typing that all out! Sadly I won't read it all.", "Jesse what the fuck are you talking about??", "▼you're fucking bananas if you think I'm reading all that, take my downvote and shut up idiot", "Are you feeling okay bud?") - -AGENDAPOSTER_PHRASE = 'trans lives matter' - -AGENDAPOSTER_MSG = """Hi @{username},\n\nYour {type} has been automatically removed because you forgot to include `{AGENDAPOSTER_PHRASE}`.\n\nDon't worry, we're here to help! We won't let you post or comment anything that doesn't express your love and acceptance towards the trans community. Feel free to resubmit your {type} with `{AGENDAPOSTER_PHRASE}` included. \n\n*This is an automated message; if you need help, you can message us [here](/contact).*""" - NOTIFICATIONS_ID = 1 AUTOJANNY_ID = 2 SNAPPY_ID = 3 @@ -369,14 +304,6 @@ AWARDS = { "color": "text-blue", "price": 1500 }, - "agendaposter": { - "kind": "agendaposter", - "title": "Chud", - "description": "Forces the chud theme on the recipient for 24 hours.", - "icon": "fas fa-snooze", - "color": "text-purple", - "price": 2500 - }, "deflector": { "kind": "deflector", "title": "Deflector", @@ -600,33 +527,9 @@ email_regex = re.compile('[^@]+@[^@]+\.[^@]+', flags=re.A) utm_regex = re.compile('utm_[a-z]+=[a-z0-9_]+&', flags=re.A) utm_regex2 = re.compile('[?&]utm_[a-z]+=[a-z0-9_]+', flags=re.A) -slur_regex = re.compile(f"({single_words})(?![^<]*>)", flags=re.I|re.A) -slur_regex_upper = re.compile(f"({single_words.upper()})(?![^<]*>)", flags=re.A) -torture_regex = re.compile('(^|\s)(i|me) ', flags=re.I|re.A) -torture_regex2 = re.compile("(^|\s)i'm ", flags=re.I|re.A) - -def sub_matcher(match): - return SLURS[match.group(0).lower()] - -def sub_matcher_upper(match): - return SLURS[match.group(0).lower()].upper() - -def censor_slurs(body, logged_user): - if not logged_user or logged_user == 'chat' or logged_user.slurreplacer: - body = slur_regex_upper.sub(sub_matcher_upper, body) - body = slur_regex.sub(sub_matcher, body) - return body - -def torture_ap(body, username): - for k, l in AJ_REPLACEMENTS.items(): - body = body.replace(k, l) - body = torture_regex.sub(rf'\1@{username} ', body) - body = torture_regex2.sub(rf'\1@{username} is ', body) - return body - YOUTUBE_KEY = environ.get("YOUTUBE_KEY", "").strip() -ADMIGGERS = (37696,37697,37749,37833,37838) +ADMINISTRATORS = (37696, 37697, 37749, 37833, 37838) proxies = {"http":"http://127.0.0.1:18080","https":"http://127.0.0.1:18080"} diff --git a/files/helpers/jinja2.py b/files/helpers/jinja2.py index 6841a4a23..803ebfe28 100644 --- a/files/helpers/jinja2.py +++ b/files/helpers/jinja2.py @@ -49,4 +49,4 @@ def timestamp(timestamp): @app.context_processor def inject_constants(): - return {"environ":environ, "SITE":SITE, "SITE_NAME":SITE_NAME, "SITE_FULL":SITE_FULL, "AUTOJANNY_ID":AUTOJANNY_ID, "NOTIFICATIONS_ID":NOTIFICATIONS_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "PIZZASHILL_ID":PIZZASHILL_ID, "config":app.config.get, "DEFAULT_COLOR":DEFAULT_COLOR, "COLORS":COLORS, "ADMIGGERS":ADMIGGERS} + return {"environ":environ, "SITE":SITE, "SITE_NAME":SITE_NAME, "SITE_FULL":SITE_FULL, "AUTOJANNY_ID":AUTOJANNY_ID, "NOTIFICATIONS_ID":NOTIFICATIONS_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "PIZZASHILL_ID":PIZZASHILL_ID, "config":app.config.get, "DEFAULT_COLOR":DEFAULT_COLOR, "COLORS":COLORS, "ADMIGGERS":ADMINISTRATORS} diff --git a/files/routes/admin.py b/files/routes/admin.py index f510b1ec2..9dbf6fd99 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -914,77 +914,6 @@ def admin_removed_comments(v): ) -@app.post("/agendaposter/") -@admin_level_required(2) -def agendaposter(user_id, v): - user = g.db.query(User).filter_by(id=user_id).one_or_none() - - days = request.values.get("days") or 30 - expiry = float(days) - expiry = int(time.time() + expiry*60*60*24) - - user.agendaposter = expiry - g.db.add(user) - - for alt in user.alts: - if alt.admin_level: return {"error": "User is an admin!"} - alt.agendaposter = expiry - g.db.add(alt) - - note = f"for {days} days" - - ma = ModAction( - kind="agendaposter", - user_id=v.id, - target_user_id=user.id, - note = note - ) - g.db.add(ma) - - if not user.has_badge(28): - badge = Badge(user_id=user.id, badge_id=28) - g.db.add(badge) - g.db.flush() - send_notification(user.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}") - - - send_repeatable_notification(user.id, f"@{v.username} has marked you as a chud ({note}).") - - g.db.commit() - - return redirect(user.url) - - - -@app.post("/unagendaposter/") -@admin_level_required(2) -def unagendaposter(user_id, v): - user = g.db.query(User).filter_by(id=user_id).one_or_none() - - user.agendaposter = 0 - g.db.add(user) - - for alt in user.alts: - alt.agendaposter = 0 - g.db.add(alt) - - ma = ModAction( - kind="unagendaposter", - user_id=v.id, - target_user_id=user.id - ) - - g.db.add(ma) - - badge = user.has_badge(28) - if badge: g.db.delete(badge) - - send_repeatable_notification(user.id, f"@{v.username} has unmarked you as a chud.") - - g.db.commit() - return {"message": "Chud theme disabled!"} - - @app.post("/shadowban/") @limiter.limit("1/second;30/minute;200/hour;1000/day") @admin_level_required(2) @@ -1502,9 +1431,6 @@ def api_unban_comment(c_id, v): comment = g.db.query(Comment).filter_by(id=c_id).one_or_none() if not comment: abort(404) - if comment.author.agendaposter and AGENDAPOSTER_PHRASE not in comment.body.lower(): - return {"error": "You can't bypass the chud award!"} - if comment.is_banned: ma=ModAction( kind="unban_comment", diff --git a/files/routes/awards.py b/files/routes/awards.py index 6339969d5..2105a065d 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -213,18 +213,6 @@ def award_post(pid, v): cache.delete_memoized(frontlist) else: post.stickied_utc = t g.db.add(post) - elif kind == "agendaposter" and not (author.agendaposter and author.agendaposter == 0): - if author.marseyawarded: - return {"error": "This user is the under the effect of a conflicting award: Marsey award."}, 404 - - if author.agendaposter and time.time() < author.agendaposter: author.agendaposter += 86400 - else: author.agendaposter = int(time.time()) + 86400 - - if not author.has_badge(28): - badge = Badge(user_id=author.id, badge_id=28) - g.db.add(badge) - g.db.flush() - send_notification(author.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}") elif kind == "flairlock": new_name = note[:100].replace("𒐪","") if not new_name and author.flairchanged: @@ -451,18 +439,6 @@ def award_comment(cid, v): c.is_pinned_utc = None else: c.is_pinned_utc = t g.db.add(c) - elif kind == "agendaposter" and not (author.agendaposter and author.agendaposter == 0): - if author.marseyawarded: - return {"error": "This user is the under the effect of a conflicting award: Marsey award."}, 404 - - if author.agendaposter and time.time() < author.agendaposter: author.agendaposter += 86400 - else: author.agendaposter = int(time.time()) + 86400 - - if not author.has_badge(28): - badge = Badge(user_id=author.id, badge_id=28) - g.db.add(badge) - g.db.flush() - send_notification(author.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}") elif kind == "flairlock": new_name = note[:100].replace("𒐪","") if not new_name and author.flairchanged: diff --git a/files/routes/chat.py b/files/routes/chat.py index 004b2b4b3..706595093 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -55,7 +55,7 @@ def speak(data, v): "namecolor": v.namecolor, "text": text, "text_html": text_html, - "text_censored": censor_slurs(text_html, 'chat'), + "text_censored": text, "time": int(time.time()) } diff --git a/files/routes/comments.py b/files/routes/comments.py index fc2580e93..7ebd585cb 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -189,7 +189,7 @@ def api_comment(v): with open(f"snappy_{SITE_NAME}.txt", "a", encoding="utf-8") as f: f.write('\n{[para]}\n' + body) - if parent_post.id not in ADMIGGERS: + if parent_post.id not in ADMINISTRATORS: if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')): return {"error":"You have to type more than 280 characters!"}, 403 elif v.bird and len(body) > 140: @@ -258,13 +258,9 @@ def api_comment(v): body += f"\n\n{url}" else: return {"error": "Image/Video files only"}, 400 - if v.agendaposter and not v.marseyawarded and parent_post.id not in ADMIGGERS: - body = torture_ap(body, v.username) - body_html = sanitize(body, comment=True) - - if parent_post.id not in ADMIGGERS and '!slots' not in body.lower() and '!blackjack' not in body.lower() and '!wordle' not in body.lower() and AGENDAPOSTER_PHRASE not in body.lower(): + if parent_post.id not in ADMINISTRATORS and '!slots' not in body.lower() and '!blackjack' not in body.lower() and '!wordle' not in body.lower(): existing = g.db.query(Comment.id).filter(Comment.author_id == v.id, Comment.deleted_utc == 0, Comment.parent_comment_id == parent_comment_id, @@ -278,7 +274,7 @@ def api_comment(v): is_bot = bool(request.headers.get("Authorization")) - if '!slots' not in body.lower() and '!blackjack' not in body.lower() and '!wordle' not in body.lower() and parent_post.id not in ADMIGGERS and not is_bot and not v.marseyawarded and AGENDAPOSTER_PHRASE not in body.lower() and len(body) > 10: + if '!slots' not in body.lower() and '!blackjack' not in body.lower() and '!wordle' not in body.lower() and parent_post.id not in ADMINISTRATORS and not is_bot and not v.marseyawarded and len(body) > 10: now = int(time.time()) cutoff = now - 60 * 60 * 24 @@ -366,39 +362,7 @@ def api_comment(v): g.db.add(c_choice) - if parent_post.id not in ADMIGGERS: - if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower(): - - c.is_banned = True - c.ban_reason = "AutoJanny" - - g.db.add(c) - - - body = AGENDAPOSTER_MSG.format(username=v.username, type='comment', AGENDAPOSTER_PHRASE=AGENDAPOSTER_PHRASE) - - body_jannied_html = sanitize(body) - - - - c_jannied = Comment(author_id=NOTIFICATIONS_ID, - parent_submission=parent_submission, - distinguish_level=6, - parent_comment_id=c.id, - level=level+1, - is_bot=True, - body_html=body_jannied_html, - top_comment_id=c.top_comment_id, - ghost=parent_post.ghost - ) - - g.db.add(c_jannied) - g.db.flush() - - n = Notification(comment_id=c_jannied.id, user_id=v.id) - g.db.add(n) - - + if parent_post.id not in ADMINISTRATORS: if not v.shadowbanned: notify_users = NOTIFY_USERS(body, v) @@ -447,7 +411,7 @@ def api_comment(v): check_for_blackjack_commands(body, v, c) - if not c.slots_result and not c.blackjack_result and v.marseyawarded and parent_post.id not in ADMIGGERS and marseyaward_body_regex.search(body_html): + if not c.slots_result and not c.blackjack_result and v.marseyawarded and parent_post.id not in ADMINISTRATORS and marseyaward_body_regex.search(body_html): return {"error":"You can only type marseys!"}, 403 check_for_treasure(body, c) @@ -487,9 +451,6 @@ def edit_comment(cid, v): elif v.bird and len(body) > 140: return {"error":"You have to type less than 140 characters!"}, 403 - if v.agendaposter and not v.marseyawarded: - body = torture_ap(body, v.username) - if not c.options: for i in poll_regex.finditer(body): body = body.replace(i.group(0), "") @@ -518,7 +479,7 @@ def edit_comment(cid, v): body_html = sanitize(body, edit=True) - if '!slots' not in body.lower() and '!blackjack' not in body.lower() and '!wordle' not in body.lower() and AGENDAPOSTER_PHRASE not in body.lower(): + if '!slots' not in body.lower() and '!blackjack' not in body.lower() and '!wordle' not in body.lower(): now = int(time.time()) cutoff = now - 60 * 60 * 24 @@ -592,39 +553,6 @@ def edit_comment(cid, v): 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 not c.is_banned: - - c.is_banned = True - c.ban_reason = "AutoJanny" - - g.db.add(c) - - - body = AGENDAPOSTER_MSG.format(username=v.username, type='comment', AGENDAPOSTER_PHRASE=AGENDAPOSTER_PHRASE) - - body_jannied_html = sanitize(body) - - - - c_jannied = Comment(author_id=NOTIFICATIONS_ID, - parent_submission=c.parent_submission, - distinguish_level=6, - parent_comment_id=c.id, - level=c.level+1, - is_bot=True, - body_html=body_jannied_html, - top_comment_id=c.top_comment_id, - ghost=c.ghost - ) - - g.db.add(c_jannied) - g.db.flush() - - n = Notification(comment_id=c_jannied.id, user_id=v.id) - g.db.add(n) - - - if int(time.time()) - c.created_utc > 60 * 3: c.edited_utc = int(time.time()) g.db.add(c) diff --git a/files/routes/front.py b/files/routes/front.py index 73c6d3941..4d9612cf0 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -227,14 +227,6 @@ def front_all(v, sub=None, subdomain=None): g.db.add(v) g.db.commit() - if v.agendaposter and v.agendaposter < time.time(): - v.agendaposter = 0 - send_repeatable_notification(v.id, "Your chud theme has expired!") - g.db.add(v) - badge = v.has_badge(28) - if badge: g.db.delete(badge) - g.db.commit() - if v.flairchanged and v.flairchanged < time.time(): v.flairchanged = None send_repeatable_notification(v.id, "Your flair lock has expired. You can now change your flair!") diff --git a/files/routes/posts.py b/files/routes/posts.py index b45a5656b..c2d174305 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -434,7 +434,6 @@ def edit_post(pid, v): return {"error":"You have to type less than 140 characters!"}, 403 if title != p.title: - if v.id == p.author_id and v.agendaposter and not v.marseyawarded: title = torture_ap(title, v.username) title_html = filter_emojis_only(title, edit=True) @@ -467,8 +466,6 @@ def edit_post(pid, v): else: return {"error": "Image/Video files only"}, 400 if body != p.body: - if v.id == p.author_id and v.agendaposter and not v.marseyawarded: body = torture_ap(body, v.username) - if not p.options: for i in poll_regex.finditer(body): body = body.replace(i.group(0), "") @@ -498,7 +495,6 @@ def edit_post(pid, v): if v.id == p.author_id and v.marseyawarded and marseyaward_body_regex.search(body_html): return {"error":"You can only type marseys!"}, 403 - p.body = body if blackjack and any(i in f'{p.body} {p.title} {p.url}'.lower() for i in blackjack.split()): @@ -510,37 +506,6 @@ def edit_post(pid, v): p.body_html = body_html - if v.id == p.author_id and v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in f'{p.body}{p.title}'.lower() and not p.is_banned: - - p.is_banned = True - p.ban_reason = "AutoJanny" - - g.db.add(p) - - body = AGENDAPOSTER_MSG.format(username=v.username, type='post', AGENDAPOSTER_PHRASE=AGENDAPOSTER_PHRASE) - - body_jannied_html = sanitize(body) - - c_jannied = Comment(author_id=NOTIFICATIONS_ID, - parent_submission=p.id, - level=1, - over_18=False, - is_bot=True, - app_id=None, - is_pinned='AutoJanny', - distinguish_level=6, - body_html=body_jannied_html, - ghost=p.ghost - ) - - g.db.add(c_jannied) - g.db.flush() - - c_jannied.top_comment_id = c_jannied.id - - n = Notification(comment_id=c_jannied.id, user_id=v.id) - g.db.add(n) - if not p.private and not p.ghost: notify_users = NOTIFY_USERS(f'{p.title} {p.body}', v) if notify_users: @@ -789,21 +754,10 @@ def submit_post(v, sub=None): if v.is_suspended: return error("You can't perform this action while banned.") - if v.agendaposter and not v.marseyawarded: title = torture_ap(title, v.username) - title_html = filter_emojis_only(title, graceful=True) - if v.marseyawarded and not marseyaward_title_regex.fullmatch(title_html): - return error("You can only type marseys!") - if len(title_html) > 1500: return error("Rendered title is too big!") - if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')): - return error("You have to type more than 280 characters!") - elif v.bird and len(body) > 140: - return error("You have to type less than 140 characters!") - - embed = None if url: @@ -889,7 +843,6 @@ def submit_post(v, sub=None): if not title: return error("Please enter a better title.") - elif len(title) > 500: return error("There's a 500 character limit for titles.") @@ -969,8 +922,6 @@ def submit_post(v, sub=None): choices.append(i.group(1)) body = body.replace(i.group(0), "") - if v.agendaposter and not v.marseyawarded: body = torture_ap(body, v.username) - if request.files.get("file2") and request.headers.get("cf-ipcountry") != "T1": files = request.files.getlist('file2')[:4] for file in files: @@ -995,9 +946,6 @@ def submit_post(v, sub=None): body_html = sanitize(body) - if v.marseyawarded and marseyaward_body_regex.search(body_html): - return error("You can only type marseys!") - if len(body_html) > 40000: return error("Submission body_html too long! (max 40k characters)") club = bool(request.values.get("club","")) @@ -1006,11 +954,6 @@ def submit_post(v, sub=None): is_bot = bool(request.headers.get("Authorization")) - if request.values.get("ghost") and v.coins >= 100: - v.coins -= 100 - ghost = True - else: ghost = False - post = Submission( private=bool(request.values.get("private","")), club=club, @@ -1025,7 +968,7 @@ def submit_post(v, sub=None): title=title[:500], title_html=title_html, sub=sub, - ghost=ghost + ghost=False ) g.db.add(post) @@ -1104,9 +1047,6 @@ def submit_post(v, sub=None): if not post.thumburl and post.url: gevent.spawn(thumbnail_thread, post.id) - - - if not post.private and not post.ghost: notify_users = NOTIFY_USERS(f'{title} {body}', v) @@ -1126,40 +1066,6 @@ def submit_post(v, sub=None): if post.club and not user.paid_dues: continue add_notif(cid, user.id) - - - - - if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in f'{post.body}{post.title}'.lower(): - post.is_banned = True - post.ban_reason = "AutoJanny" - - body = AGENDAPOSTER_MSG.format(username=v.username, type='post', AGENDAPOSTER_PHRASE=AGENDAPOSTER_PHRASE) - - body_jannied_html = sanitize(body) - - - - c_jannied = Comment(author_id=NOTIFICATIONS_ID, - parent_submission=post.id, - level=1, - over_18=False, - is_bot=True, - app_id=None, - is_pinned='AutoJanny', - distinguish_level=6, - body_html=body_jannied_html, - ) - - g.db.add(c_jannied) - g.db.flush() - - c_jannied.top_comment_id = c_jannied.id - - n = Notification(comment_id=c_jannied.id, user_id=v.id) - g.db.add(n) - - v.post_count = g.db.query(Submission.id).filter_by(author_id=v.id, is_banned=False, deleted_utc=0).count() g.db.add(v) diff --git a/files/routes/settings.py b/files/routes/settings.py index 06e8d066a..b7b39ca0e 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -611,8 +611,6 @@ def settings_css_get(v): @limiter.limit("1/second;30/minute;200/hour;1000/day") @auth_required def settings_css(v): - if v.agendaposter: return {"error": "Agendapostered users can't edit css!"} - css = request.values.get("css").strip().replace('\\', '').strip()[:4000] v.css = css g.db.add(v) diff --git a/files/routes/users.py b/files/routes/users.py index b31366af4..f9e8e28d2 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -252,12 +252,6 @@ def grassed(v): return render_template("grassed.html", v=v, users=users) -@app.get("/agendaposters") -@auth_required -def agendaposters(v): - users = [x for x in g.db.query(User).filter(User.agendaposter > 0).order_by(User.username).all()] - return render_template("agendaposters.html", v=v, users=users) - @app.get("/@/upvoters") @auth_required diff --git a/files/routes/votes.py b/files/routes/votes.py index e9bd716d3..e32130b75 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -94,7 +94,7 @@ def api_vote_post(post_id, new, v): post.author.truecoins += coin_delta g.db.add(post.author) - if new == 1 and (v.agendaposter or v.shadowbanned or (v.is_banned and not v.unban_utc) or (v.profile_url.startswith('/e/') and not v.customtitle and v.namecolor == DEFAULT_COLOR)): real = False + if new == 1 and (v.shadowbanned or (v.is_banned and not v.unban_utc) or (v.profile_url.startswith('/e/') and not v.customtitle and v.namecolor == DEFAULT_COLOR)): real = False else: real = True vote = Vote(user_id=v.id, @@ -162,7 +162,7 @@ def api_vote_comment(comment_id, new, v): comment.author.truecoins += coin_delta g.db.add(comment.author) - if new == 1 and (v.agendaposter or v.shadowbanned or (v.is_banned and not v.unban_utc) or (v.profile_url.startswith('/e/') and not v.customtitle and v.namecolor == DEFAULT_COLOR)): real = False + if new == 1 and (v.shadowbanned or (v.is_banned and not v.unban_utc) or (v.profile_url.startswith('/e/') and not v.customtitle and v.namecolor == DEFAULT_COLOR)): real = False else: real = True vote = CommentVote(user_id=v.id, diff --git a/files/templates/admin/admin_home.html b/files/templates/admin/admin_home.html index 6b705fe68..24984bf41 100644 --- a/files/templates/admin/admin_home.html +++ b/files/templates/admin/admin_home.html @@ -22,7 +22,6 @@
  • Users Feed
  • Shadowbanned Users
  • Permabanned Users
  • -
  • Users with Chud Theme
  • Currently Grassed Users
  • diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 757c559a1..e6788f1ff 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -17,25 +17,7 @@ - {% if v.agendaposter %} - - {% elif v.css %} + {% if v.css %} {% endif %} {% else %} diff --git a/files/templates/comments.html b/files/templates/comments.html index 1c5ca6340..143d65579 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -287,7 +287,7 @@ {% endif %} -
    +
    {{c.realbody(v) | safe}}
    {% if c.parent_submission %} diff --git a/files/templates/default.html b/files/templates/default.html index 19f5476cf..c61070479 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -10,25 +10,7 @@ - {% if v.agendaposter %} - - {% elif v.css %} + {% if v.css %} {% endif %} {% else %} diff --git a/files/templates/log.html b/files/templates/log.html index e123bfbfe..10baf68c7 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -8,25 +8,7 @@ - {% if v.agendaposter %} - - {% elif v.css %} + {% if v.css %} {% endif %} {% else %} diff --git a/files/templates/settings.html b/files/templates/settings.html index 557e05960..dabc19418 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -36,25 +36,7 @@ - {% if v.agendaposter %} - - {% elif v.css and not request.path.startswith('/settings/css') %} + {% if v.css and not request.path.startswith('/settings/css') %} {% endif %} diff --git a/files/templates/submission.html b/files/templates/submission.html index 3fd0c75c2..86752ea67 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -495,13 +495,13 @@
    {% endif %} {% if p.realurl(v) %} -

    +

    {% if p.club %}{{CC}}{% endif %} {% if p.flair %}{{p.flair | safe}}{% endif %} {{p.realtitle(v) | safe}}

    {% else %} -

    +

    {% if p.club %}{{CC}}{% endif %} {% if p.flair %}{{p.flair | safe}}{% endif %} {{p.realtitle(v) | safe}} @@ -535,7 +535,7 @@ {% endif %} -
    +
    {% if p.is_image %}
    diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 13c4af51c..e3b77a0f2 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -202,7 +202,7 @@
    - + {% if p.club %}{{CC}}{% endif %} {% if p.flair %}{{p.flair | safe}}{% endif %} {{p.realtitle(v) | safe}} @@ -340,7 +340,7 @@ {% if not p.club or v and (v.paid_dues or v.id == p.author_id) %} {% if p.realbody(v) %} -
    +
    {{p.realbody(v) | safe}}
    {% endif %} diff --git a/files/templates/submit.html b/files/templates/submit.html index ecd17cd07..149653a50 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -24,25 +24,7 @@ - {% if v.agendaposter %} - - {% elif v.css %} + {% if v.css %} {% endif %} {% else %} diff --git a/files/templates/userpage.html b/files/templates/userpage.html index b2c2195f7..fc9803ce0 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -248,14 +248,6 @@ {% endif %}
    
    -
    -						
    - - - -
    -
    Disable Chud Theme -
    
     
     						Shadowban
    @@ -533,14 +525,6 @@
     							
     						{% endif %}
     						
    
    -
    -						
    - - - -
    - Disable Chud Theme -
    
     
     						Shadowban