Remove some gimmicky r/drama features.

Co-authored-by: Inire <>
This commit is contained in:
FatherInire 2022-05-22 12:43:00 +10:00 committed by GitHub
parent 31cb9e049f
commit fcba426009
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 29 additions and 539 deletions

View file

@ -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;
}

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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',

View file

@ -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

View file

@ -520,7 +520,6 @@ 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.startswith('/'): return SITE_FULL + self.profileurl
return self.profileurl

View file

@ -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"}

View file

@ -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}

View file

@ -914,77 +914,6 @@ def admin_removed_comments(v):
)
@app.post("/agendaposter/<user_id>")
@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/<user_id>")
@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/<user_id>")
@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",

View file

@ -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:

View file

@ -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())
}

View file

@ -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)

View file

@ -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!")

View file

@ -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)

View file

@ -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)

View file

@ -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("/@<username>/upvoters")
@auth_required

View file

@ -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,

View file

@ -22,7 +22,6 @@
<li><a href="/admin/users">Users Feed</a></li>
<li><a href="/admin/shadowbanned">Shadowbanned Users</a></li>
<li><a href="/banned">Permabanned Users</a></li>
<li><a href="/agendaposters">Users with Chud Theme</a></li>
<li><a href="/grassed">Currently Grassed Users</a></li>
</ul>

View file

@ -17,25 +17,7 @@
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=250">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=56">
{% if v.agendaposter %}
<style>
html {
cursor:url('/assets/images/dildo.webp?v=1008'), auto;
}
.nav-item .text-small.font-weight-bold::before {
content: "((("
}
.nav-item .text-small.font-weight-bold::after {
content: ")))"
}
.nav-item .text-small-extra.text-primary {
font-size: 0 !important
}
.nav-item .text-small-extra.text-primary i {
font-size: 11px !important
}
</style>
{% elif v.css %}
{% if v.css %}
<link rel="stylesheet" href="/@{{v.username}}/css">
{% endif %}
{% else %}

View file

@ -287,7 +287,7 @@
</style>
{% endif %}
<div id="comment-text-{{c.id}}" class="comment-text mb-0 {% if c.author.agendaposter %}agendaposter{% endif %}">
<div id="comment-text-{{c.id}}" class="comment-text mb-0">
{{c.realbody(v) | safe}}
</div>
{% if c.parent_submission %}

View file

@ -10,25 +10,7 @@
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=250">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=56">
{% if v.agendaposter %}
<style>
html {
cursor:url('/assets/images/dildo.webp?v=1008'), auto;
}
.nav-item .text-small.font-weight-bold::before {
content: "((("
}
.nav-item .text-small.font-weight-bold::after {
content: ")))"
}
.nav-item .text-small-extra.text-primary {
font-size: 0 !important
}
.nav-item .text-small-extra.text-primary i {
font-size: 11px !important
}
</style>
{% elif v.css %}
{% if v.css %}
<link rel="stylesheet" href="/@{{v.username}}/css">
{% endif %}
{% else %}

View file

@ -8,25 +8,7 @@
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=250">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=56">
{% if v.agendaposter %}
<style>
html {
cursor:url('/assets/images/dildo.webp?v=1008'), auto;
}
.nav-item .text-small.font-weight-bold::before {
content: "((("
}
.nav-item .text-small.font-weight-bold::after {
content: ")))"
}
.nav-item .text-small-extra.text-primary {
font-size: 0 !important
}
.nav-item .text-small-extra.text-primary i {
font-size: 11px !important
}
</style>
{% elif v.css %}
{% if v.css %}
<link rel="stylesheet" href="/@{{v.username}}/css">
{% endif %}
{% else %}

View file

@ -36,25 +36,7 @@
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=250">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=56">
{% if v.agendaposter %}
<style>
html {
cursor:url('/assets/images/dildo.webp?v=1008'), auto;
}
.nav-item .text-small.font-weight-bold::before {
content: "((("
}
.nav-item .text-small.font-weight-bold::after {
content: ")))"
}
.nav-item .text-small-extra.text-primary {
font-size: 0 !important
}
.nav-item .text-small-extra.text-primary i {
font-size: 11px !important
}
</style>
{% elif v.css and not request.path.startswith('/settings/css') %}
{% if v.css and not request.path.startswith('/settings/css') %}
<link rel="stylesheet" href="/@{{v.username}}/css">
{% endif %}
</head>

View file

@ -495,13 +495,13 @@
</div>
{% endif %}
{% if p.realurl(v) %}
<h1 id="post-title" class="card-title post-title text-left mb-md-3 {% if p.author.agendaposter %}agendaposter{% endif %}"><a {% if not v or v.newtabexternal %}target="_blank"{% endif %} rel="nofollow noopener noreferrer" href="{{p.realurl(v)}}">
<h1 id="post-title" class="card-title post-title text-left mb-md-3"><a {% if not v or v.newtabexternal %}target="_blank"{% endif %} rel="nofollow noopener noreferrer" href="{{p.realurl(v)}}">
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{CC}}</span>{% endif %}
{% if p.flair %}<span class="patron font-weight-bolder mr-1" style="background-color:var(--primary); font-size:12px; line-height:2;">{{p.flair | safe}}</span>{% endif %}
{{p.realtitle(v) | safe}}
</a></h1>
{% else %}
<h1 id="post-title" class="card-title post-title text-left mb-md-3 {% if p.author.agendaposter %}agendaposter{% endif %}">
<h1 id="post-title" class="card-title post-title text-left mb-md-3">
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{CC}}</span>{% endif %}
{% if p.flair %}<span class="patron font-weight-bolder mr-1" style="background-color:var(--primary); font-size:12px; line-height:2;">{{p.flair | safe}}</span>{% endif %}
{{p.realtitle(v) | safe}}
@ -535,7 +535,7 @@
{% endif %}
<div id="post-text" {% if p.author.agendaposter %}class="agendaposter"{% endif %}>
<div id="post-text">
{% if p.is_image %}
<div class="row no-gutters">
<div class="col">

View file

@ -202,7 +202,7 @@
</div>
<h5 class="card-title post-title text-left w-lg-95 mb-0 pb-0 pb-md-1">
<a id="{{p.id}}-title" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} href="{{p.permalink}}" class="{% if voted and v.id == AEVANN_ID %}visited{% endif %} stretched-link {% if p.author.agendaposter %}agendaposter{% endif %}">
<a id="{{p.id}}-title" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} href="{{p.permalink}}" class="{% if voted and v.id == AEVANN_ID %}visited{% endif %} stretched-link">
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{CC}}</span>{% endif %}
{% if p.flair %}<span class="patron font-weight-bolder mr-1" style="background-color:var(--primary); font-size:12px; line-height:2;">{{p.flair | safe}}</span>{% 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) %}
<div class="d-none card rounded border pt-3 pb-2 my-2 {% if p.author.agendaposter %}agendaposter{% endif %}" id="post-text-{{p.id}}">
<div class="d-none card rounded border pt-3 pb-2 my-2" id="post-text-{{p.id}}">
{{p.realbody(v) | safe}}
</div>
{% endif %}

View file

@ -24,25 +24,7 @@
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=250">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=49">
{% if v.agendaposter %}
<style>
html {
cursor:url('/assets/images/dildo.webp?v=1008'), auto;
}
.nav-item .text-small.font-weight-bold::before {
content: "((("
}
.nav-item .text-small.font-weight-bold::after {
content: ")))"
}
.nav-item .text-small-extra.text-primary {
font-size: 0 !important
}
.nav-item .text-small-extra.text-primary i {
font-size: 11px !important
}
</style>
{% elif v.css %}
{% if v.css %}
<link rel="stylesheet" href="/@{{v.username}}/css">
{% endif %}
{% else %}

View file

@ -248,14 +248,6 @@
</form>
{% endif %}
<pre></pre>
<form id="agendaposter1" class="{% if u.agendaposter %}d-none{% endif %}" action="/agendaposter/{{u.id}}" method="post">
<input type="hidden" name="formkey", value="{{v.formkey}}">
<input autocomplete="off" type="number" step="any" name="days" class="form-control" placeholder="Days (0 or blank = permanent)">
<input type="submit" class="btn btn-danger" value="Lock Chud Theme">
</form>
<a id="unagendaposter" class="{% if not u.agendaposter %}d-none{% endif %} btn btn-success" role="button" onclick="post_toast2(this,'/unagendaposter/{{u.id}}','agendaposter1','unagendaposter')">Disable Chud Theme</a>
<pre></pre>
<a id="shadowban" class="{% if u.shadowbanned %}d-none{% endif %} btn btn-danger" role="button" onclick="post_toast2(this,'/shadowban/{{u.id}}','shadowban','unshadowban')">Shadowban</a>
@ -533,14 +525,6 @@
</form>
{% endif %}
<pre></pre>
<form id="agendaposter2" class="{% if u.agendaposter %}d-none{% endif %}" action="/agendaposter/{{u.id}}" method="post">
<input type="hidden" name="formkey", value="{{v.formkey}}">
<input autocomplete="off" type="number" step="any" name="days" class="form-control" placeholder="Days (0 or blank = permanent)">
<input type="submit" class="btn btn-danger" value="Lock Chud Theme">
</form>
<a id="unagendaposter2" class="{% if not u.agendaposter %}d-none{% endif %} btn btn-success" role="button" onclick="post_toast2(this,'/unagendaposter/{{u.id}}','agendaposter2','unagendaposter2')">Disable Chud Theme</a>
<pre></pre>
<a id="shadowban2" class="{% if u.shadowbanned %}d-none{% endif %} btn btn-danger" role="button" onclick="post_toast2(this,'/shadowban/{{u.id}}','shadowban2','unshadowban2')">Shadowban</a>