Merge branch 'master into 'marsey-caching'

pull/15/head
justcool393 2022-11-27 10:54:42 -06:00
parent 5ab4a8400c
commit e654040b96
92 changed files with 708 additions and 484 deletions

17
.gitignore vendored
View File

@ -1,23 +1,10 @@
image.*
video.mp4
unsanitized.mp4
cache/
__pycache__/
.idea/
**/.pytest_cache/
.*
venv/
.vscode/
.sass-cache/
flask_session/
.DS_Store
site_settings.json
/files/test.py
tags
__pycache__/
# Chat environment
chat/node_modules
chat/build
chat/.env
# Chat artefacts
files/assets/css/chat_done.css

View File

@ -1,7 +1,6 @@
.ChatMessage {
position: relative;
padding-right: 1.5rem;
overflow: hidden;
max-height: 300px;
}
@ -39,6 +38,7 @@
align-items: center;
justify-content: space-between;
padding-left: 30px;
overflow: hidden;
}
.ChatMessage-content {

View File

@ -15,17 +15,26 @@ services:
depends_on:
- redis
- postgres
logging:
options:
max-size: "100k"
max-file: "1"
redis:
container_name: "redis"
image: redis
ports:
- "6379:6379"
logging:
options:
max-size: "100k"
max-file: "1"
postgres:
container_name: "postgres"
image: postgres
command: ["postgres", "-c", "log_statement=all"]
#command: ["postgres", "-c", "log_statement=all"]
volumes:
- "./schema.sql:/docker-entrypoint-initdb.d/00-schema.sql"
- "./seed-db.sql:/docker-entrypoint-initdb.d/10-seed-db.sql"
@ -33,9 +42,17 @@ services:
- POSTGRES_HOST_AUTH_METHOD=trust
ports:
- "5432:5432"
logging:
options:
max-size: "100k"
max-file: "1"
opera-proxy:
container_name: "opera-proxy"
image: yarmak/opera-proxy
ports:
- "18080:18080"
logging:
options:
max-size: "100k"
max-file: "1"

View File

@ -1853,7 +1853,7 @@ button.close {
color: #fff;
text-align: center;
background-color: #000;
border-radius: 0.35rem;
border-radius: 0.2rem;
}
.popover {
position: absolute;
@ -6384,3 +6384,18 @@ div.markdown {
object-fit: cover;
max-height: min(42vh,30vw) !important;
}
.modlog-action {
display: flex;
flex-wrap: wrap;
background: var(--gray-600) !important;
position: relative;
align-items: center;
justify-content: space-between;
overflow-wrap: anywhere;
padding: 1rem 1rem 1rem 1rem;
}
.modlog-action:not(:first-of-type) {
border-top: 1px solid var(--gray-400) !important;
}

View File

@ -664,6 +664,7 @@
{"name":"brainletchadmask","class":"Wojak"},
{"name":"bruce","class":"Wojak"},
{"name":"chadagent","class":"Wojak"},
{"name":"chadpostal","class":"Wojak"},
{"name":"chadblack2","class":"Wojak"},
{"name":"chadsnoo","class":"Wojak"},
{"name":"daddysgirl","class":"Wojak"},
@ -694,6 +695,7 @@
{"name":"trumpjaktalking","class":"Wojak"},
{"name":"rdramajanny","tags": ["janny"],"class":"Wojak"},
{"name":"soyreddit","class":"Wojak"},
{"name":"soysnoo","class":"Wojak"},
{"name":"doomerboy","class":"Wojak"},
{"name":"npcsupport","class":"Wojak"},
{"name":"npcoppse","class":"Wojak"},
@ -761,6 +763,7 @@
{"name":"chudgrug","class":"Wojak"},
{"name":"chudnazi","class":"Wojak"},
{"name":"chudsmug","class":"Wojak"},
{"name":"chudglassesglow","class":"Wojak"},
{"name":"soy4dchess","class":"Wojak"},
{"name":"soyjaktantrum","class":"Wojak"},
{"name":"psychojak","class":"Wojak"},
@ -807,6 +810,7 @@
{"name":"chadyescapy", "tags":["capy", "aevann"],"class":"Misc"},
{"name":"chadnocapy", "tags":["capy", "aevann"],"class":"Misc"},
{"name":"capygitcommit", "tags":["capy", "aevann"],"class":"Misc"},
{"name":"capyantischizo", "class":"Misc"},
{"name":"capysneedboat", "tags":["capy", "aevann"],"class":"Misc"},
{"name":"chadbasedcapy", "tags":["capy", "aevann"],"class":"Misc"},
{"name":"chadcopecapy", "tags":["capy", "aevann"],"class":"Misc"},
@ -842,6 +846,7 @@
{"name":"brookscringe","class":"Misc"},
{"name":"brooksjustright","class":"Misc"},
{"name":"brookskiss","class":"Misc"},
{"name":"brooksbailiffunamused","class":"Misc"},
{"name":"opperblink","tags":["sue", "opper", "darrell", "brooks", "prosecutor", "district", "attorney", "da", "annoyed", "irritated", "waukesha"],"class":"Misc"},
{"name":"gimp","class":"Misc"},
{"name":"taddance","class":"Misc","tags":["terry","davis","templeos","dance"]},
@ -852,6 +857,8 @@
{"name":"yotsubafish","class":"Misc"},
{"name":"yotsubalol","class":"Misc"},
{"name":"sigmatalking","class":"Misc"},
{"name":"peoplewhoannoy","class":"Misc"},
{"name":"pepedrum", "tags":["football","soccer"], "class":"Misc"},
{"name":"zoroarkconfused","class":"Misc"},
{"name":"zoroarkhappy","class":"Misc"},
{"name":"zoroarkpout","class":"Misc"},
@ -879,6 +886,7 @@
{"name":"gigachad","tags": ["chad"],"class":"Misc"},
{"name":"gigachad2", "tags": ["chad"], "class":"Misc"},
{"name":"gigachad3", "tags": ["chad"], "class":"Misc"},
{"name":"gigachad4", "tags": ["chad"], "class":"Misc"},
{"name":"pedobear", "class":"Misc"},
{"name":"kippy","class":"Misc"},
{"name":"onerat","class":"Misc"},
@ -886,10 +894,17 @@
{"name":"duckdance", "class":"Misc"},
{"name":"stoning","class":"Misc"},
{"name":"stoningpills","class":"Misc"},
{"name":"stoningupvotes","class":"Misc"},
{"name":"stoningdownvotes","class":"Misc"},
{"name":"stoningbans","class":"Misc"},
{"name":"stoningunbans","class":"Misc"},
{"name":"stoningpins","class":"Misc"},
{"name":"stoningunpins","class":"Misc"},
{"name":"srdinepoppy","class":"Misc"},
{"name":"gunt","class":"Misc"},
{"name":"sneedbuddy","class":"Misc"},
{"name":"chuckbuddy","class":"Misc"},
{"name":"mallocbuddy","class":"Misc"},
{"name":"soren","class":"Misc"},
{"name":"upsoren","class":"Misc"},
{"name":"downdonger","class":"Misc"},

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -180,14 +180,18 @@ function smoothScrollTop()
}
// Click navbar to scroll back to top
document.getElementsByTagName('nav')[0].addEventListener('click', (e) => {
if (e.target.id === "navbar" ||
e.target.classList.contains("container-fluid") ||
e.target.id == "navbarResponsive" ||
e.target.id == "logo-container" ||
e.target.classList.contains("srd"))
smoothScrollTop();
}, false);
const nav = document.getElementsByTagName('nav')
if (nav) {
nav[0].addEventListener('click', (e) => {
if (e.target.id === "navbar" ||
e.target.classList.contains("container-fluid") ||
e.target.id == "navbarResponsive" ||
e.target.id == "logo-container" ||
e.target.classList.contains("srd"))
smoothScrollTop();
}, false);
}
// Dynamic shadow when the user scrolls
document.addEventListener('scroll',function (event) {
@ -403,9 +407,3 @@ function sendFormXHRSwitch(e) {
}
)
}
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/service-worker.js?v=3")
.then((registration) => registration.update())
.catch((e) => console.log("Service worker update failed with error", e));
}

View File

@ -11,6 +11,18 @@ function post(url) {
function updatebgselection(){
var bgselector = document.getElementById("backgroundSelector");
const backgrounds = [
{
folder: "glitter",
backgrounds:
[
"1.webp",
"2.webp",
"3.webp",
"4.webp",
"5.webp",
"6.webp",
]
},
{
folder: "anime",
backgrounds:

File diff suppressed because one or more lines are too long

View File

@ -35,7 +35,7 @@ class OauthApp(Base):
@property
@lazy
def permalink(self):
return f"{SITE_FULL}/admin/app/{self.id}/posts"
return f"{SITE_FULL}/admin/app/{self.id}"
@lazy
def idlist(self, db:scoped_session, page=1):

View File

@ -49,6 +49,7 @@ class Comment(Base):
is_bot = Column(Boolean, default=False)
stickied = Column(String)
stickied_utc = Column(Integer)
stickied_child_id = Column(Integer)
sentto = Column(Integer, ForeignKey("users.id"))
app_id = Column(Integer, ForeignKey("oauth_apps.id"))
upvotes = Column(Integer, default=1)
@ -139,7 +140,7 @@ class Comment(Base):
if self.replies2 != None:
return self.replies2
replies = db.query(Comment).filter_by(parent_comment_id=self.id).order_by(Comment.stickied)
replies = db.query(Comment).filter_by(parent_comment_id=self.id).order_by(Comment.stickied, Comment.stickied_child_id)
if not self.parent_submission: sort='old'
return sort_objects(sort, replies, Comment,
include_shadowbanned=(v and v.can_see_shadowbanned)).all()
@ -242,7 +243,7 @@ class Comment(Base):
@lazy
def realbody(self, v):
if self.post and self.post.club and not (v and (v.paid_dues or v.id in [self.author_id, self.post.author_id] or (self.parent_comment and v.id == self.parent_comment.author_id))):
if self.post and self.post.club and not (v and (v.paid_dues or v.id in {self.author_id, self.post.author_id} or (self.parent_comment and v.id == self.parent_comment.author_id))):
return f"<p>{CC} ONLY</p>"
if self.deleted_utc != 0 and not (v and (v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or v.id == self.author.id)): return "[Deleted by user]"
if self.is_banned and not (v and v.admin_level >= PERMS['POST_COMMENT_MODERATION']) and not (v and v.id == self.author.id): return ""
@ -293,11 +294,14 @@ class Comment(Base):
if not self.ghost and self.author.show_sig(v):
body += f"<hr>{self.author.sig_html}"
if v:
body = body.replace("!YOU!", v.username)
return body
@lazy
def plainbody(self, v):
if self.post and self.post.club and not (v and (v.paid_dues or v.id in [self.author_id, self.post.author_id] or (self.parent_comment and v.id == self.parent_comment.author_id))):
if self.post and self.post.club and not (v and (v.paid_dues or v.id in {self.author_id, self.post.author_id} or (self.parent_comment and v.id == self.parent_comment.author_id))):
return f"{CC} ONLY"
if self.deleted_utc != 0 and not (v and (v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or v.id == self.author.id)): return "[Deleted by user]"
if self.is_banned and not (v and v.admin_level >= PERMS['POST_COMMENT_MODERATION']) and not (v and v.id == self.author.id): return ""
@ -308,6 +312,9 @@ class Comment(Base):
body = censor_slurs(body, v).replace('<img loading="lazy" data-bs-toggle="tooltip" alt=":marseytrain:" title=":marseytrain:" src="/e/marseytrain.webp">', ':marseytrain:')
if v:
body = body.replace("!YOU!", v.username)
return body
@lazy

View File

@ -324,6 +324,9 @@ class Submission(Base):
if not listing and not self.ghost and self.author.show_sig(v):
body += f"<hr>{self.author.sig_html}"
if v:
body = body.replace("!YOU!", v.username)
return body
@lazy
@ -337,6 +340,10 @@ class Submission(Base):
body = censor_slurs(body, v).replace('<img loading="lazy" data-bs-toggle="tooltip" alt=":marseytrain:" title=":marseytrain:" src="/e/marseytrain.webp">', ':marseytrain:')
body = normalize_urls_runtime(body, v)
if v:
body = body.replace("!YOU!", v.username)
return body
@lazy
@ -350,6 +357,9 @@ class Submission(Base):
title = censor_slurs(title, v)
if v:
title = title.replace("!YOU!", v.username)
return title
@lazy
@ -361,6 +371,9 @@ class Submission(Base):
title = censor_slurs(title, v).replace('<img loading="lazy" data-bs-toggle="tooltip" alt=":marseytrain:" title=":marseytrain:" src="/e/marseytrain.webp">', ':marseytrain:')
if v:
title = title.replace("!YOU!", v.username)
return title
@property

View File

@ -141,7 +141,6 @@ class User(Base):
subscriptions = relationship("Subscription", back_populates="user")
following = relationship("Follow", primaryjoin="Follow.user_id==User.id", back_populates="user")
followers = relationship("Follow", primaryjoin="Follow.target_id==User.id", back_populates="target")
viewers = relationship("ViewerRelationship", primaryjoin="User.id == ViewerRelationship.user_id")
blocking = relationship("UserBlock", lazy="dynamic", primaryjoin="User.id==UserBlock.user_id", back_populates="user")
blocked = relationship("UserBlock", lazy="dynamic", primaryjoin="User.id==UserBlock.target_id", back_populates="target")
authorizations = relationship("ClientAuth", back_populates="user")
@ -248,7 +247,10 @@ class User(Base):
if self.marsify > 1:
user_forced_hats.append(val)
elif getattr(self, k):
user_forced_hats.append(val)
if k == 'agendaposter':
user_forced_hats.append(random.choice(val))
else:
user_forced_hats.append(val)
if user_forced_hats: return random.choice(user_forced_hats)
else: return None
@ -875,7 +877,7 @@ class User(Base):
def get_relationship_count(self, relationship_cls):
# TODO: deduplicate (see routes/users.py)
if relationship_cls in [SaveRelationship, Subscription]:
if relationship_cls in {SaveRelationship, Subscription}:
query = relationship_cls.submission_id
join = relationship_cls.post
cls = Submission
@ -942,17 +944,6 @@ class User(Base):
def can_create_hole(self):
return self.admin_level >= PERMS['HOLE_CREATE']
@property
@lazy
def viewers_recorded(self):
if SITE_NAME == 'WPD': # WPD gets profile views
return True
elif self.admin_level >= PERMS['VIEW_PROFILE_VIEWS']: # Admins get profile views
return True
elif self.patron: # Patrons get profile views as a perk
return True
return False
@property
@lazy
def patron_tooltip(self):
@ -1000,6 +991,7 @@ class User(Base):
if not cls.can_see(user, other.author): return False
if user and user.id == other.author_id: return True
if isinstance(other, Submission):
if "!YOU!" in other.title and not user: return False
if other.sub and not cls.can_see(user, other.subr): return False
else:
if not other.parent_submission:
@ -1015,7 +1007,6 @@ class User(Base):
return (user and user.id == other.id) or (user and user.can_see_shadowbanned) or not other.shadowbanned
return True
@property
@lazy
def can_see_chudrama(self):
@ -1029,10 +1020,10 @@ class User(Base):
@property
@lazy
def can_post_in_ghost_threads(self):
if not TRUESCORE_GHOST_LIMIT: return True
if not TRUESCORE_GHOST_MINIMUM: return True
if self.admin_level >= PERMS['POST_IN_GHOST_THREADS']: return True
if self.club_allowed: return True
if self.truescore >= TRUESCORE_GHOST_LIMIT: return True
if self.truescore >= TRUESCORE_GHOST_MINIMUM: return True
if self.patron: return True
return False

View File

@ -457,18 +457,18 @@ def execute_lawlz_actions(v:User, p:Submission):
pin_time = 'for 1 day'
ma_1=ModAction(
kind="pin_post",
user_id=v.id,
user_id=AUTOJANNY_ID,
target_submission_id=p.id,
_note=pin_time
)
ma_2=ModAction(
kind="distinguish_post",
user_id=v.id,
user_id=AUTOJANNY_ID,
target_submission_id=p.id
)
ma_3=ModAction(
kind="flair_post",
user_id=v.id,
user_id=AUTOJANNY_ID,
target_submission_id=p.id,
_note=f'"{p.flair}"'
)

View File

@ -98,6 +98,7 @@ AJ_REPLACEMENTS = {
SLURS = {
"nigger": "BIPOC",
"negroid": "BIPOC",
"niglet": 'BIPOClet',
"negress": "BIPOC woman",
'nigga': 'neighbor',
@ -149,6 +150,7 @@ if SITE_NAME == 'rDrama':
"republican": 'republiKKKan',
"america": 'ameriKKKa',
"it's almost as if": "I'm a retard but",
"my brother in christ": "my brother in Allah",
}
SLURS.update(RDRAMA_SLURS)
@ -197,6 +199,7 @@ WPD_CHANNEL_ID = 1013990963846332456
PIN_AWARD_TEXT = " (pin award)"
THEMES = ["4chan","classic","classic_dark","coffee","dark","dramblr","light","midnight","transparent","tron","win98"]
BACKGROUND_CATEGORIES = ["glitter", "anime", "fantasy", "solarpunk", "pixelart"]
COMMENT_SORTS = ["hot", "new", "old", "top", "bottom", "controversial"]
SORTS = COMMENT_SORTS + ["bump", "comments"]
TIME_FILTERS = ["hour", "day", "week", "month", "year", "all"]
@ -255,8 +258,6 @@ PERMS = { # Minimum admin_level to perform action.
'VIEW_CHUDRAMA': 1,
'VIEW_PRIVATE_PROFILES': 2,
'VIEW_ALTS': 2,
'VIEW_PROFILE_VIEWS': 2,
'VIEW_SORTED_ADMIN_LIST': 3,
'VIEW_ACTIVE_USERS': 2,
'VIEW_ALL_USERS': 2,
'VIEW_ALT_VOTES': 2,
@ -390,10 +391,10 @@ COMMENT_MAX_DEPTH = 200
TRANSFER_MESSAGE_LENGTH_LIMIT = 200 # do not make larger than 10000 characters (comment limit) without altering the table
MIN_REPOST_CHECK_URL_LENGTH = 9 # also change the constant in checkRepost() of submit.js
CHAT_LENGTH_LIMIT = 1000
TRUESCORE_DONATE_LIMIT = 100
COSMETIC_AWARD_COIN_AWARD_PCT = 0.10
TRUESCORE_CHAT_LIMIT = 0
TRUESCORE_GHOST_LIMIT = 0
TRUESCORE_CHAT_MINIMUM = 0
TRUESCORE_DONATE_MINIMUM = 100
TRUESCORE_GHOST_MINIMUM = 0
LOGGEDIN_ACTIVE_TIME = 15 * 60
PFP_DEFAULT_MARSEY = True
@ -461,7 +462,8 @@ MAX_VIDEO_SIZE_MB = 32
MAX_VIDEO_SIZE_MB_PATRON = 64
MAX_IMAGE_CONVERSION_TIMEOUT = 15 # seconds
ANTISPAM_BYPASS_IDS = ()
ANTISPAM_BYPASS_IDS = set()
BOOSTED_USERS_EXCLUDED = set()
PAGE_SIZE = 25
LEADERBOARD_LIMIT = PAGE_SIZE
@ -495,8 +497,8 @@ if SITE == 'rdrama.net':
NOTIFICATION_THREAD = 6489
CHAT_LENGTH_LIMIT = 200
TRUESCORE_CHAT_LIMIT = 10
TRUESCORE_GHOST_LIMIT = 10
TRUESCORE_CHAT_MINIMUM = 10
TRUESCORE_GHOST_MINIMUM = 10
NEW_USER_HAT_AGE = 7 * 86400
HOLE_COST = 50000
@ -530,7 +532,34 @@ if SITE == 'rdrama.net':
GEESE_ID = 1710
BLACKJACKBTZ_ID = 12732
ANTISPAM_BYPASS_IDS = (1703, 13427)
ANTISPAM_BYPASS_IDS = {1703, 13427}
BOOSTED_HOLES = {
'furry',
'femboy',
'anime',
'gaybros',
'againsthateholes',
'masterbaiters',
'changelog',
}
BOOSTED_USERS = {
IMPASSIONATA_ID,
PIZZASHILL_ID,
SNAKES_ID,
JUSTCOOL_ID,
2008, #TransGirlTradWife
29, #QuadNarca
JOAN_ID,
}
BOOSTED_USERS_EXCLUDED = {
8768,
3402,
5214,
12719
}
GIFT_NOTIF_ID = CARP_ID
@ -576,35 +605,40 @@ elif SITE == 'watchpeopledie.tv':
PERMS['HOLE_CREATE'] = 2
PERMS['POST_EDITING'] = 2
PERMS['ADMIN_ADD'] = 4
ERROR_TITLES[400] = "Bad Request"
ERROR_TITLES[401] = "Unauthorized"
ERROR_TITLES[403] = "Forbidden"
ERROR_TITLES[404] = "Not Found"
ERROR_TITLES[405] = "Method Not Allowed"
ERROR_TITLES[406] = "Too Many Pings"
ERROR_TITLES[409] = "Mortal Conflict"
ERROR_TITLES[410] = "Dead"
ERROR_TITLES[413] = "Payload Too Large"
ERROR_TITLES[415] = "Unsupported Media Type"
ERROR_TITLES[500] = "Internal Server Error"
ERROR_MSGS[400] = "That request is invalid"
ERROR_MSGS[401] = "You need to login or sign up to do that"
ERROR_MSGS[403] = "You're not allowed to do that"
ERROR_MSGS[404] = "That wasn't found"
ERROR_MSGS[405] = "You can't use this method here... if you keep getting this error tell us it's prolly something borked"
ERROR_MSGS[409] = "There's a conflict between what you're trying to do and what you or someone else has done and because of that you can't do what you're trying to do."
ERROR_MSGS[410] = "This link is dead. Request a new one to try again"
ERROR_MSGS[413] = "You need to upload a smaller file please"
ERROR_MSGS[429] = "Please wait a bit before doing that"
ERROR_TITLES.update({
400: "Bad Request",
401: "Unauthorized",
403: "Forbidden",
404: "Not Found",
405: "Method Not Allowed",
406: "Too Many Pings",
409: "Mortal Conflict",
410: "Dead",
413: "Payload Too Large",
415: "Unsupported Media Type",
500: "Internal Server Error",
})
ERROR_MSGS.update({
400: "That request is invalid",
401: "You need to login or sign up to do that",
403: "You're not allowed to do that",
404: "That wasn't found",
405: "You can't use this method here... if you keep getting this error tell us it's prolly something borked",
409: "There's a conflict between what you're trying to do and what you or someone else has done and because of that you can't do what you're trying to do.",
410: "This link is dead. Request a new one to try again",
413: "You need to upload a smaller file please",
429: "Please wait a bit before doing that",
})
POLL_THREAD = 13225
SIDEBAR_THREAD = 5403
BANNER_THREAD = 9869
TRUESCORE_CHAT_LIMIT = 10
TRUESCORE_GHOST_LIMIT = 10
TRUESCORE_CHAT_MINIMUM = 10
TRUESCORE_GHOST_MINIMUM = 10
HOLE_NAME = 'flair'
HOLE_STYLE_FLAIR = True
@ -1419,9 +1453,7 @@ NOTIFIED_USERS = {
}
FORTUNE_REPLIES = ('<b style="color:#6023f8">Your fortune: Allah Wills It</b>','<b style="color:#d302a7">Your fortune: Inshallah, Only Good Things Shall Come To Pass</b>','<b style="color:#e7890c">Your fortune: Allah Smiles At You This Day</b>','<b style="color:#7fec11">Your fortune: Your Bussy Is In For A Blasting</b>','<b style="color:#43fd3b">Your fortune: You Will Be Propositioned By A High-Tier Twink</b>','<b style="color:#9d05da">Your fortune: Repent, You Have Displeased Allah And His Vengeance Is Nigh</b>','<b style="color:#f51c6a">Your fortune: Reply Hazy, Try Again</b>','<b style="color:#00cbb0">Your fortune: lmao you just lost 100 coins</b>','<b style="color:#2a56fb">Your fortune: Yikes 😬</b>','<b style="color:#0893e1">Your fortune: You Will Be Blessed With Many Black Bulls</b>','<b style="color:#16f174">Your fortune: NEETmax, The Day Is Lost If You Venture Outside</b>','<b style="color:#fd4d32">Your fortune: A Taste Of Jannah Awaits You Today</b>','<b style="color:#bac200">Your fortune: Watch Your Back</b>','<b style="color:#6023f8">Your fortune: Outlook good</b>','<b style="color:#d302a7">Your fortune: Godly Luck</b>','<b style="color:#e7890c">Your fortune: Good Luck</b>','<b style="color:#7fec11">Your fortune: Bad Luck</b>','<b style="color:#43fd3b">Your fortune: Good news will come to you by mail</b>','<b style="color:#9d05da">Your fortune: Very Bad Luck</b>','<b style="color:#00cbb0">Your fortune: キタ━━━━━━(゚∀゚)━━━━━━ !!!!</b>','<b style="color:#2a56fb">Your fortune: Better not tell you now</b>','<b style="color:#0893e1">Your fortune: You will meet a dark handsome stranger</b>','<b style="color:#16f174">Your fortune:  ´_ゝ`)フーン</b>','<b style="color:#fd4d32">Your fortune: Excellent Luck</b>','<b style="color:#bac200">Your fortune: Average Luck</b>')
FACTCHECK_REPLIES = ('<b style="color:#6023f8">Factcheck: This claim has been confirmed as correct by experts. </b>','<b style="color:#d302a7">Factcheck: This claim has been classified as misogynistic.</b>','<b style="color:#e7890c">Factcheck: This claim is currently being debunked.</b>','<b style="color:#7fec11">Factcheck: This claim is 100% true.</b>','<b style="color:#9d05da">Factcheck: This claim hurts trans lives.</b>','<b style="color:#f51c6a">Factcheck: [REDACTED].</b>','<b style="color:#00cbb0">Factcheck: This claim is both true and false.</b>','<b style="color:#2a56fb">Factcheck: You really believe that shit? Lmao dumbass nigga 🤣</b>','<b style="color:#0893e1">Factcheck: None of this is real.</b>','<b style="color:#16f174">Factcheck: Yes.</b>','<b style="color:#fd4d32">Factcheck: This claim has not been approved by experts.</b>','<b style="color:#bac200">Factcheck: This claim is a gross exageration of reality.</b>','<b style="color:#ff2200">Factcheck: WARNING! THIS CLAIM HAS BEEN CLASSIFIED AS DANGEROUS. PLEASE REMAIN STILL, AN AGENT WILL COME TO MEET YOU SHORTLY.</b>')
EIGHTBALL_REPLIES = ('<b style="color:#7FEC11">The 8-Ball Says: It is certain.</b>', '<b style="color:#7FEC11">The 8-Ball Says: It is decidedly so.</b>', '<b style="color:#7FEC11">The 8-Ball Says: Without a doubt.</b>', '<b style="color:#7FEC11">The 8-Ball Says: Yes definitely.</b>', '<b style="color:#7FEC11">The 8-Ball Says: You may rely on it.</b>', '<b style="color:#7FEC11">The 8-Ball Says: As I see it, yes.</b>', '<b style="color:#7FEC11">The 8-Ball Says: Most likely.</b>', '<b style="color:#7FEC11">The 8-Ball Says: Outlook good.</b>', '<b style="color:#7FEC11">The 8-Ball Says: Yes.</b>', '<b style="color:#7FEC11">The 8-Ball Says: Signs point to yes.</b>', '<b style="color:#E7890C">The 8-Ball Says: Reply hazy, try again.</b>', '<b style="color:#E7890C">The 8-Ball Says: Ask again later.</b>', '<b style="color:#E7890C">The 8-Ball Says: Better not tell you now.</b>', '<b style="color:#E7890C">The 8-Ball Says: Cannot predict now.</b>', '<b style="color:#E7890C">The 8-Ball Says: Concentrate and ask again.</b>', '<b style="color:#FD4D32">The 8-Ball Says: Don\'t count on it.</b>', '<b style="color:#FD4D32">The 8-Ball Says: My reply is no.</b>', '<b style="color:#FD4D32">The 8-Ball Says: My sources say no.</b>', '<b style="color:#FD4D32">The 8-Ball Says: Outlook not so good.</b>', '<b style="color:#FD4D32">The 8-Ball Says: Very doubtful.</b>')
REDDIT_NOTIFS_SITE = set()
@ -1588,7 +1620,12 @@ forced_hats = {
"earlylife": ("The Merchant", "SHUT IT DOWN, the goys know!"),
"marsify": ("Marsified", "I can't pick my own Marseys, help!"),
"is_suspended": ("Behind Bars", "This user is banned and needs to do better!"),
"agendaposter": ("Egg_irl", "This user is getting in touch with xir identity!")
"agendaposter": (("Egg_irl", "This user is getting in touch with xir identity!"),
("Trans Flag", "Just in case you forgot, trans lives matter."),
("Trans Flag II", "Your egg is cracked; wear it with pride!"),
("Pride Flag", "Never forget that this is a primarily gay community. Dude bussy lmao."),
("Pride Flag II", "This user is a proud supporter of LGBTQ+ rights."))
}
EMAIL_REGEX_PATTERN = '[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{2,63}\.[A-Za-z]{2,63}'
@ -1662,6 +1699,7 @@ if SITE_NAME == 'rDrama':
'backloggd.com',
'tildes.net',
'blacktwitterapp.com',
'dailystormer.in',
#fediverse
'rdrama.cc',
@ -1676,26 +1714,6 @@ if SITE_NAME == 'rDrama':
'seal.cafe',
}
BOOSTED_HOLES = {
'furry',
'femboy',
'anime',
'gaybros',
'againsthateholes',
'masterbaiters',
'changelog',
}
BOOSTED_USERS = {
IMPASSIONATA_ID,
PIZZASHILL_ID,
SNAKES_ID,
JUSTCOOL_ID,
2008, #TransGirlTradWife
}
BOOSTED_USERS_EXCLUDED = {8768, 5214, 12719, 3402}
IMAGE_FORMATS = ['png','gif','jpg','jpeg','webp']
VIDEO_FORMATS = ['mp4','webm','mov','avi','mkv','flv','m4v','3gp']
AUDIO_FORMATS = ['mp3','wav','ogg','aac','m4a','flac']

View File

@ -243,7 +243,7 @@ def add_block_props(target:Union[Submission, Comment, User], v:Optional[User]):
if not v: return target
id = None
if any(isinstance(target, cls) for cls in [Submission, Comment]):
if any(isinstance(target, cls) for cls in {Submission, Comment}):
id = target.author_id
elif isinstance(target, User):
id = target.id

View File

@ -52,7 +52,7 @@ def allowed_attributes(tag, name, value):
if name == 'style': return True
if tag == 'marquee':
if name in ['direction', 'behavior', 'scrollamount']: return True
if name in {'direction', 'behavior', 'scrollamount'}: return True
if name in {'height', 'width'}:
try: value = int(value.replace('px', ''))
except: return False
@ -67,11 +67,11 @@ def allowed_attributes(tag, name, value):
return False
if tag == 'img':
if name in ['src','data-src']: return is_safe_url(value)
if name in {'src','data-src'}: return is_safe_url(value)
if name == 'loading' and value == 'lazy': return True
if name == 'data-bs-toggle' and value == 'tooltip': return True
if name in ['g','b','glow'] and not value: return True
if name in ['alt','title']: return True
if name in {'g','b','glow'} and not value: return True
if name in {'alt','title'}: return True
return False
if tag == 'lite-youtube':
@ -426,8 +426,8 @@ def allowed_attributes_emojis(tag, name, value):
if name == 'src' and value.startswith('/') and '\\' not in value: return True
if name == 'loading' and value == 'lazy': return True
if name == 'data-bs-toggle' and value == 'tooltip': return True
if name in ['g','glow'] and not value: return True
if name in ['alt','title']: return True
if name in {'g','glow'} and not value: return True
if name in {'alt','title'}: return True
if tag == 'span':
if name == 'data-bs-toggle' and value == 'tooltip': return True

View File

@ -546,9 +546,11 @@ def badge_grant_post(v):
if desc: new_badge.description = desc
url = request.values.get("url")
if '\\' in url: abort(400)
if url: new_badge.url = url
if url:
if '\\' in url: abort(400)
if url.startswith(SITE_FULL):
url = url.split(SITE_FULL, 1)[1]
new_badge.url = url
g.db.add(new_badge)
g.db.flush()
@ -829,7 +831,7 @@ def admin_removed_comments(v):
try: page = int(request.values.get("page", 1))
except: page = 1
ids = g.db.query(Comment.id).join(Comment.author).filter(or_(Comment.is_banned==True, User.shadowbanned != None)).order_by(Comment.id.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
ids = g.db.query(Comment.id).join(Comment.author).filter(or_(Comment.is_banned==True, User.shadowbanned != None)).order_by(Comment.id.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE + 1).all()
ids=[x[0] for x in ids]
next_exists = len(ids) > PAGE_SIZE
ids = ids[:PAGE_SIZE]
@ -1332,6 +1334,12 @@ def sticky_comment(cid, v):
message = f"@{v.username} (Admin) has pinned your [comment]({comment.shortlink})"
send_repeatable_notification(comment.author_id, message)
c = comment
while c.level > 2:
c = c.parent_comment
c.stickied_child_id = comment.id
g.db.add(c)
return {"message": "Comment pinned!"}
@ -1357,6 +1365,11 @@ def unsticky_comment(cid, v):
message = f"@{v.username} (Admin) has unpinned your [comment]({comment.shortlink})"
send_repeatable_notification(comment.author_id, message)
cleanup = g.db.query(Comment).filter_by(stickied_child_id=comment.id).all()
for c in cleanup:
c.stickied_child_id = None
g.db.add(c)
return {"message": "Comment unpinned!"}

View File

@ -28,7 +28,7 @@ def asset_submissions(path):
@app.get("/submit/marseys")
@auth_required
def submit_marseys(v):
def submit_marseys(v:User):
if v.admin_level >= PERMS['VIEW_PENDING_SUBMITTED_MARSEYS']:
marseys = g.db.query(Marsey).filter(Marsey.submitter_id != None).all()
else:
@ -43,7 +43,7 @@ def submit_marseys(v):
@app.post("/submit/marseys")
@auth_required
def submit_marsey(v):
def submit_marsey(v:User):
file = request.files["image"]
name = request.values.get('name', '').lower().strip()
tags = request.values.get('tags', '').lower().strip()
@ -195,12 +195,12 @@ def remove_asset(cls, type_name:str, v:User, name:str) -> dict[str, str]:
@app.post("/remove/marsey/<name>")
@auth_required
def remove_marsey(v, name):
def remove_marsey(v:User, name):
return remove_asset(Marsey, "marsey", v, name)
@app.get("/submit/hats")
@auth_required
def submit_hats(v):
def submit_hats(v:User):
if v.admin_level >= PERMS['VIEW_PENDING_SUBMITTED_HATS']: hats = g.db.query(HatDef).filter(HatDef.submitter_id != None).all()
else: hats = g.db.query(HatDef).filter(HatDef.submitter_id == v.id).all()
return render_template("submit_hats.html", v=v, hats=hats)
@ -208,7 +208,7 @@ def submit_hats(v):
@app.post("/submit/hats")
@auth_required
def submit_hat(v):
def submit_hat(v:User):
name = request.values.get('name', '').strip()
description = request.values.get('description', '').strip()
username = request.values.get('author', '').strip()
@ -328,7 +328,7 @@ def approve_hat(v, name):
@app.post("/remove/hat/<name>")
@auth_required
def remove_hat(v, name):
def remove_hat(v:User, name):
return remove_asset(HatDef, 'hat', v, name)
@app.get("/admin/update/marseys")

View File

@ -22,7 +22,7 @@ from .front import frontlist
@app.get("/shop")
@app.get("/settings/shop")
@auth_required
def shop(v):
def shop(v:User):
AWARDS = deepcopy(AWARDS2)
if v.house:
@ -46,7 +46,7 @@ def shop(v):
@app.post("/buy/<award>")
@limiter.limit("100/minute;200/hour;1000/day")
@auth_required
def buy(v, award):
def buy(v:User, award):
if award == 'benefactor' and not request.values.get("mb"):
abort(403, "You can only buy the Benefactor award with marseybux.")
@ -200,7 +200,7 @@ def award_thing(v, thing_type, id):
author = v
elif kind != 'spider':
awarded_coins = int(AWARDS[kind]['price'] * COSMETIC_AWARD_COIN_AWARD_PCT) if AWARDS[kind]['cosmetic'] else 0
if AWARDS[kind]['cosmetic']:
if AWARDS[kind]['cosmetic'] and kind != 'shit':
author.pay_account('coins', awarded_coins)
msg = f"@{v.username} has given your [{thing_type}]({thing.shortlink}) the {AWARDS[kind]['title']} Award"

View File

@ -14,7 +14,7 @@ from files.__main__ import app, limiter
@app.get("/casino")
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def casino(v):
def casino(v:User):
if v.rehab:
return render_template("casino/rehab.html", v=v), 403
@ -24,7 +24,7 @@ def casino(v):
@app.get("/casino/<game>")
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def casino_game_page(v, game):
def casino_game_page(v:User, game):
if v.rehab:
return render_template("casino/rehab.html", v=v), 403
elif game not in CASINO_GAME_KINDS:
@ -53,7 +53,7 @@ def casino_game_page(v, game):
@app.get("/casino/<game>/feed")
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def casino_game_feed(v, game):
def casino_game_feed(v:User, game):
if v.rehab:
abort(403, "You are under Rehab award effect!")
elif game not in CASINO_GAME_KINDS:
@ -67,7 +67,7 @@ def casino_game_feed(v, game):
@app.get("/lottershe")
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def lottershe(v):
def lottershe(v:User):
if v.rehab:
return render_template("casino/rehab.html", v=v)
@ -78,7 +78,7 @@ def lottershe(v):
@app.post("/casino/slots")
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def pull_slots(v):
def pull_slots(v:User):
if v.rehab:
abort(403, "You are under Rehab award effect!")
@ -109,7 +109,7 @@ def pull_slots(v):
@app.post("/casino/twentyone/deal")
@limiter.limit("1/second;100/minute;2000/hour;12000/day")
@auth_required
def blackjack_deal_to_player(v):
def blackjack_deal_to_player(v:User):
if v.rehab:
abort(403, "You are under Rehab award effect!")
@ -128,7 +128,7 @@ def blackjack_deal_to_player(v):
@app.post("/casino/twentyone/hit")
@limiter.limit("1/second;100/minute;2000/hour;12000/day")
@auth_required
def blackjack_player_hit(v):
def blackjack_player_hit(v:User):
if v.rehab:
abort(403, "You are under Rehab award effect!")
@ -143,7 +143,7 @@ def blackjack_player_hit(v):
@app.post("/casino/twentyone/stay")
@limiter.limit("1/second;100/minute;2000/hour;12000/day")
@auth_required
def blackjack_player_stay(v):
def blackjack_player_stay(v:User):
if v.rehab:
abort(403, "You are under Rehab award effect!")
@ -158,7 +158,7 @@ def blackjack_player_stay(v):
@app.post("/casino/twentyone/double-down")
@limiter.limit("1/second;100/minute;2000/hour;12000/day")
@auth_required
def blackjack_player_doubled_down(v):
def blackjack_player_doubled_down(v:User):
if v.rehab:
abort(403, "You are under Rehab award effect!")
@ -173,7 +173,7 @@ def blackjack_player_doubled_down(v):
@app.post("/casino/twentyone/buy-insurance")
@limiter.limit("1/second;100/minute;2000/hour;12000/day")
@auth_required
def blackjack_player_bought_insurance(v):
def blackjack_player_bought_insurance(v:User):
if v.rehab:
abort(403, "You are under Rehab award effect!")
@ -188,7 +188,7 @@ def blackjack_player_bought_insurance(v):
@app.get("/casino/roulette/bets")
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def roulette_get_bets(v):
def roulette_get_bets(v:User):
if v.rehab:
abort(403, "You are under Rehab award effect!")
@ -200,7 +200,7 @@ def roulette_get_bets(v):
@app.post("/casino/roulette/place-bet")
@limiter.limit("100/minute;2000/hour;12000/day")
@auth_required
def roulette_player_placed_bet(v):
def roulette_player_placed_bet(v:User):
if v.rehab:
abort(403, "You are under Rehab award effect!")

View File

@ -39,8 +39,8 @@ user_ids_to_socket_ids = {}
@app.get("/chat")
@is_not_permabanned
def chat(v):
if TRUESCORE_CHAT_LIMIT and v.truescore < TRUESCORE_CHAT_LIMIT and not v.club_allowed:
abort(403, f"Need at least {TRUESCORE_CHAT_LIMIT} truescore for access to chat.")
if TRUESCORE_CHAT_MINIMUM and v.truescore < TRUESCORE_CHAT_MINIMUM and not v.club_allowed:
abort(403, f"Need at least {TRUESCORE_CHAT_MINIMUM} truescore for access to chat.")
return render_template("chat.html", v=v, messages=messages)
@ -50,7 +50,7 @@ def chat(v):
@ratelimit_user("3/second;10/minute")
def speak(data, v):
if v.is_banned: return '', 403
if TRUESCORE_CHAT_LIMIT and v.truescore < TRUESCORE_CHAT_LIMIT and not v.club_allowed: return '', 403
if TRUESCORE_CHAT_MINIMUM and v.truescore < TRUESCORE_CHAT_MINIMUM and not v.club_allowed: return '', 403
vname = v.username.lower()
if vname in muted and not v.admin_level >= PERMS['CHAT_BYPASS_MUTE']:

View File

@ -79,10 +79,11 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
else: template = "submission.html"
return render_template(template, v=v, p=post, sort=sort, comment_info=comment_info, render_replies=True, sub=post.subr)
#- API
@app.post("/comment")
@limiter.limit("1/second;20/minute;200/hour;1000/day")
@ratelimit_user("1/second;20/minute;200/hour;1000/day")
@auth_required
@ratelimit_user("1/second;20/minute;200/hour;1000/day")
def comment(v):
if v.is_suspended: abort(403, "You can't perform this action while banned.")
@ -91,7 +92,7 @@ def comment(v):
id = parent_fullname[2:]
parent_comment_id = None
rts = False
if parent_fullname.startswith("p_"):
parent = get_post(id, v=v)
parent_post = parent
@ -101,7 +102,7 @@ def comment(v):
parent_post = get_post(parent.parent_submission, v=v)
parent_comment_id = parent.id
if parent.author_id == v.id: rts = True
if not v.can_post_in_ghost_threads and parent_post.ghost: abort(403, f"You need {TRUESCORE_GHOST_LIMIT} truescore to post in ghost threads")
if not v.can_post_in_ghost_threads and parent_post.ghost: abort(403, f"You need {TRUESCORE_GHOST_MINIMUM} truescore to post in ghost threads")
else: abort(400)
level = 1 if isinstance(parent, Submission) else parent.level + 1
@ -359,6 +360,13 @@ def comment(v):
check_slots_command(v, v, c)
if c.level > 5:
n = g.db.query(Notification).filter_by(
comment_id=c.parent_comment.parent_comment.parent_comment.parent_comment_id,
user_id=c.parent_comment.author_id,
).one_or_none()
if n: g.db.delete(n)
g.db.flush()
if v.client: return c.json(db=g.db)
@ -368,8 +376,8 @@ def comment(v):
@app.post("/edit_comment/<cid>")
@limiter.limit("1/second;10/minute;100/hour;200/day")
@ratelimit_user("1/second;10/minute;100/hour;200/day")
@is_not_permabanned
@ratelimit_user("1/second;10/minute;100/hour;200/day")
def edit_comment(cid, v):
c = get_comment(cid, v=v)

View File

@ -43,7 +43,7 @@ def front_all(v, sub=None, subdomain=None):
#### WPD TEMP #### end special front logic
if sub:
sub = get_sub_by_name(sub, graceful=True)
if sub and not User.can_see(v, sub): abort(403)
if sub and not User.can_see(v, sub): abort(403, "You need 5000 truescore to be able to see /h/chudrama")
if (request.path.startswith('/h/') or request.path.startswith('/s/')) and not sub: abort(404)
@ -179,7 +179,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
@app.get("/random_post")
@auth_required
def random_post(v):
def random_post(v:User):
p = g.db.query(Submission.id).filter(Submission.deleted_utc == 0, Submission.is_banned == False, Submission.private == False).order_by(func.random()).first()
@ -191,7 +191,7 @@ def random_post(v):
@app.get("/random_user")
@auth_required
def random_user(v):
def random_user(v:User):
u = g.db.query(User.username).filter(User.song != None, User.shadowbanned == None).order_by(func.random()).first()
if u: u = u[0]
@ -202,7 +202,7 @@ def random_user(v):
@app.get("/comments")
@auth_required
def all_comments(v):
def all_comments(v:User):
try: page = max(int(request.values.get("page", 1)), 1)
except: page = 1

View File

@ -9,7 +9,7 @@ from files.__main__ import app, limiter
@app.get("/hats")
@auth_required
def hats(v):
def hats(v:User):
owned_hat_ids = [x.hat_id for x in v.owned_hats]
if request.values.get("sort") == 'author_asc':
@ -34,7 +34,7 @@ def hats(v):
@app.post("/buy_hat/<hat_id>")
@limiter.limit('100/minute;1000/3 days')
@auth_required
def buy_hat(v, hat_id):
def buy_hat(v:User, hat_id):
try: hat_id = int(hat_id)
except: abort(404, "Hat not found!")
@ -84,7 +84,7 @@ def buy_hat(v, hat_id):
@app.post("/equip_hat/<hat_id>")
@auth_required
def equip_hat(v, hat_id):
def equip_hat(v:User, hat_id):
try: hat_id = int(hat_id)
except: abort(404, "Hat not found!")
@ -98,7 +98,7 @@ def equip_hat(v, hat_id):
@app.post("/unequip_hat/<hat_id>")
@auth_required
def unequip_hat(v, hat_id):
def unequip_hat(v:User, hat_id):
try: hat_id = int(hat_id)
except: abort(404, "Hat not found!")
@ -112,7 +112,7 @@ def unequip_hat(v, hat_id):
@app.get("/hat_owners/<hat_id>")
@auth_required
def hat_owners(v, hat_id):
def hat_owners(v:User, hat_id):
try: hat_id = int(hat_id)
except: abort(404, "Hat not found!")

View File

@ -61,10 +61,10 @@ def inject_constants():
"TELEGRAM_LINK":TELEGRAM_LINK, "EMAIL_REGEX_PATTERN":EMAIL_REGEX_PATTERN,
"CONTENT_SECURITY_POLICY_DEFAULT":CONTENT_SECURITY_POLICY_DEFAULT,
"CONTENT_SECURITY_POLICY_HOME":CONTENT_SECURITY_POLICY_HOME,
"TRUESCORE_DONATE_LIMIT":TRUESCORE_DONATE_LIMIT,
"TRUESCORE_DONATE_MINIMUM":TRUESCORE_DONATE_MINIMUM,
"DONATE_LINK":DONATE_LINK, "DONATE_SERVICE":DONATE_SERVICE, "BAN_EVASION_DOMAIN":BAN_EVASION_DOMAIN,
"HOUSE_JOIN_COST":HOUSE_JOIN_COST, "HOUSE_SWITCH_COST":HOUSE_SWITCH_COST, "IMAGE_FORMATS":IMAGE_FORMATS,
"PAGE_SIZES":PAGE_SIZES, "THEMES":THEMES, "COMMENT_SORTS":COMMENT_SORTS, "SORTS":SORTS,
"TIME_FILTERS":TIME_FILTERS, "HOUSES":HOUSES, "TIERS_ID_TO_NAME":TIERS_ID_TO_NAME,
"DEFAULT_CONFIG_VALUE":DEFAULT_CONFIG_VALUE, "IS_LOCALHOST":IS_LOCALHOST,
"DEFAULT_CONFIG_VALUE":DEFAULT_CONFIG_VALUE, "IS_LOCALHOST":IS_LOCALHOST, "BACKGROUND_CATEGORIES":BACKGROUND_CATEGORIES,
}

View File

@ -21,7 +21,7 @@ NO_LOGIN_REDIRECT_URLS = ("/login", "/logout", "/signup", "/forgot", "/reset", "
@app.get("/login")
@auth_desired
def login_get(v):
def login_get(v:Optional[User]):
redir = request.values.get("redirect", "/").strip().rstrip('?').lower()
if redir:
if not is_site_url(redir) or redir in NO_LOGIN_REDIRECT_URLS:
@ -106,7 +106,7 @@ def login_post():
redir = request.values.get("redirect", "").strip().rstrip('?').lower()
if redir:
if is_site_url(redir) and redir in NO_LOGIN_REDIRECT_URLS:
if is_site_url(redir) and redir not in NO_LOGIN_REDIRECT_URLS:
return redirect(redir)
return redirect('/')
@ -131,7 +131,7 @@ def on_login(account, redir=None):
@app.get("/me")
@app.get("/@me")
@auth_required
def me(v):
def me(v:User):
if v.client: return v.json
else: return redirect(v.url)
@ -149,7 +149,7 @@ def logout(v):
@app.get("/signup")
@auth_desired
def sign_up_get(v):
def sign_up_get(v:Optional[User]):
if not get_setting('Signups'):
abort(403, "New account registration is currently closed. Please come back later.")
@ -199,7 +199,7 @@ def sign_up_get(v):
@app.post("/signup")
@limiter.limit("1/second;10/day")
@auth_desired
def sign_up_post(v):
def sign_up_post(v:Optional[User]):
if not get_setting('Signups'):
abort(403, "New account registration is currently closed. Please come back later.")
@ -235,6 +235,7 @@ def sign_up_post(v):
return signup_error("There was a problem. Please try again.")
if not hmac.compare_digest(correct_formkey, form_formkey):
if SITE == 'localhost': return signup_error("There was a problem. Please try again!")
return signup_error("There was a problem. Please try again.")
if not request.values.get(
@ -339,7 +340,7 @@ def sign_up_post(v):
redir = request.values.get("redirect", "").strip().rstrip('?').lower()
if redir:
if is_site_url(redir) or redir in NO_LOGIN_REDIRECT_URLS:
if is_site_url(redir) or redir not in NO_LOGIN_REDIRECT_URLS:
return redirect(redir)
return redirect('/')
@ -416,7 +417,7 @@ def get_reset():
@app.post("/reset")
@limiter.limit(DEFAULT_RATELIMIT_SLOWER)
@auth_desired
def post_reset(v):
def post_reset(v:Optional[User]):
if v: return redirect('/')
user_id = request.values.get("user_id")
timestamp = 0
@ -454,7 +455,7 @@ def post_reset(v):
@app.get("/lost_2fa")
@auth_desired
def lost_2fa(v):
def lost_2fa(v:Optional[User]):
if v and not v.mfa_secret: abort(400, "You don't have 2FA enabled")
return render_template("login/lost_2fa.html", v=v)

View File

@ -23,7 +23,7 @@ def lottery_start(v):
@app.post("/lottery/buy")
@limiter.limit("3/second;100/minute;500/hour;1000/day")
@auth_required
def lottery_buy(v):
def lottery_buy(v:User):
try: quantity = int(request.values.get("quantity"))
except: abort(400, "Invalid ticket quantity.")
@ -40,7 +40,7 @@ def lottery_buy(v):
@app.get("/lottery/active")
@limiter.limit("3/second;100/minute;500/hour;1000/day")
@auth_required
def lottery_active(v):
def lottery_active(v:User):
lottery, participants = get_active_lottery_stats()
return {"message": "", "stats": {"user": v.lottery_stats, "lottery": lottery, "participants": participants}}

View File

@ -19,7 +19,7 @@ def verify_email(v):
@app.get("/activate")
@auth_required
def activate(v):
def activate(v:User):
email = request.values.get("email", "").strip().lower()
if not email_regex.fullmatch(email):

View File

@ -68,7 +68,7 @@ def notifications_modmail(v):
@app.get("/notifications/messages")
@auth_required
def notifications_messages(v):
def notifications_messages(v:User):
try: page = max(int(request.values.get("page", 1)), 1)
except: page = 1
@ -137,7 +137,7 @@ def notifications_messages(v):
@app.get("/notifications/posts")
@auth_required
def notifications_posts(v):
def notifications_posts(v:User):
try: page = max(int(request.values.get("page", 1)), 1)
except: page = 1
@ -179,7 +179,7 @@ def notifications_posts(v):
@app.get("/notifications/modactions")
@auth_required
def notifications_modactions(v):
def notifications_modactions(v:User):
try: page = max(int(request.values.get("page", 1)), 1)
except: page = 1
@ -218,7 +218,7 @@ def notifications_modactions(v):
@app.get("/notifications/reddit")
@auth_required
def notifications_reddit(v):
def notifications_reddit(v:User):
try: page = max(int(request.values.get("page", 1)), 1)
except: page = 1
@ -263,7 +263,7 @@ def notifications_reddit(v):
@app.get("/notifications")
@auth_required
def notifications(v):
def notifications(v:User):
try: page = max(int(request.values.get("page", 1)), 1)
except: page = 1

View File

@ -9,7 +9,7 @@ from files.__main__ import app, limiter
@app.get("/authorize")
@auth_required
def authorize_prompt(v):
def authorize_prompt(v:User):
client_id = request.values.get("client_id")
application = g.db.query(OauthApp).filter_by(client_id=client_id).one_or_none()
if not application: return {"oauth_error": "Invalid `client_id`"}, 401

View File

@ -1,5 +1,6 @@
import os
import time
import html
from io import BytesIO
from os import path
from shutil import copyfile
@ -122,7 +123,7 @@ def publish(pid, v):
@app.get("/submit")
@app.get("/h/<sub>/submit")
@auth_required
def submit_get(v, sub=None):
def submit_get(v:User, sub=None):
sub = get_sub_by_name(sub, graceful=True)
if request.path.startswith('/h/') and not sub: abort(404)
@ -310,8 +311,8 @@ def morecomments(v, cid):
@app.post("/edit_post/<pid>")
@limiter.limit("1/second;10/minute;100/hour;200/day")
@ratelimit_user("1/second;10/minute;100/hour;200/day")
@is_not_permabanned
@ratelimit_user("1/second;10/minute;100/hour;200/day")
def edit_post(pid, v):
p = get_post(pid)
if v.id != p.author_id and v.admin_level < PERMS['POST_EDITING']:
@ -392,7 +393,7 @@ def edit_post(pid, v):
p.body = body
for text in [p.body, p.title, p.url]:
for text in {p.body, p.title, p.url}:
if not execute_blackjack(v, p, text, 'submission'): break
if len(body_html) > POST_BODY_HTML_LENGTH_LIMIT:
@ -603,7 +604,7 @@ def is_repost():
@limiter.limit(POST_RATE_LIMIT)
@limiter.limit(POST_RATE_LIMIT, key_func=lambda:f'{SITE}-{session.get("lo_user")}')
@auth_required
def submit_post(v, sub=None):
def submit_post(v:User, sub=None):
url = request.values.get("url", "").strip()
@ -810,7 +811,7 @@ def submit_post(v, sub=None):
g.db.add(post)
g.db.flush()
for text in [post.body, post.title, post.url]:
for text in {post.body, post.title, post.url}:
if not execute_blackjack(v, post, text, 'submission'): break
if v and v.admin_level >= PERMS['POST_BETS']:
@ -1072,8 +1073,8 @@ extensions = IMAGE_FORMATS + VIDEO_FORMATS + AUDIO_FORMATS
@app.get("/submit/title")
@limiter.limit("3/minute")
@ratelimit_user("3/minute")
@auth_required
@ratelimit_user("3/minute")
def get_post_title(v):
POST_TITLE_TIMEOUT = 5
url = request.values.get("url")
@ -1098,4 +1099,6 @@ def get_post_title(v):
title = match.group(1)
else: abort(400)
title = html.unescape(title)
return {"url": url, "title": title}

View File

@ -45,7 +45,7 @@ def searchparse(text):
@app.get("/search/posts")
@auth_required
def searchposts(v):
def searchposts(v:User):
query = request.values.get("q", '').strip()
@ -181,7 +181,7 @@ def searchposts(v):
@app.get("/search/comments")
@auth_required
def searchcomments(v):
def searchcomments(v:User):
query = request.values.get("q", '').strip()
try: page = max(1, int(request.values.get("page", 1)))
@ -276,7 +276,7 @@ def searchcomments(v):
@app.get("/search/users")
@auth_required
def searchusers(v):
def searchusers(v:User):
query = request.values.get("q", '').strip()

View File

@ -26,12 +26,12 @@ from files.__main__ import app, cache, limiter
@app.get("/settings")
@auth_required
def settings(v):
def settings(v:User):
return redirect("/settings/personal")
@app.get("/settings/personal")
@auth_required
def settings_personal(v):
def settings_personal(v:User):
return render_template("settings/personal.html", v=v)
@app.delete('/settings/background')
@ -301,7 +301,7 @@ def settings_personal_post(v):
@app.post("/settings/filters")
@auth_required
def filters(v):
def filters(v:User):
filters=request.values.get("filters")[:1000].strip()
if filters == v.custom_filter_list:
@ -540,7 +540,7 @@ def settings_images_banner(v):
@app.get("/settings/css")
@auth_required
def settings_css_get(v):
def settings_css_get(v:User):
return render_template("settings/css.html", v=v)
@app.post("/settings/css")
@ -572,7 +572,7 @@ def settings_profilecss(v):
@app.get("/settings/security")
@auth_required
def settings_security(v):
def settings_security(v:User):
return render_template("settings/security.html",
v=v,
mfa_secret=pyotp.random_base32() if not v.mfa_secret else None,
@ -581,8 +581,8 @@ def settings_security(v):
@app.post("/settings/block")
@limiter.limit("1/second;20/day")
@ratelimit_user("1/second;20/day")
@auth_required
@ratelimit_user("1/second;20/day")
def settings_block_user(v):
user = get_user(request.values.get("username"), graceful=True)
if not user: abort(404, "This user doesn't exist.")
@ -622,12 +622,12 @@ def settings_unblock_user(v):
@app.get("/settings/apps")
@auth_required
def settings_apps(v):
def settings_apps(v:User):
return render_template("settings/apps.html", v=v)
@app.get("/settings/advanced")
@auth_required
def settings_advanced_get(v):
def settings_advanced_get(v:User):
return render_template("settings/advanced.html", v=v)
@app.post("/settings/name_change")
@ -671,8 +671,8 @@ def settings_name_change(v):
@app.post("/settings/song_change_mp3")
@feature_required('USERS_PROFILE_SONG')
@limiter.limit("3/second;10/day")
@ratelimit_user("3/second;10/day")
@auth_required
@ratelimit_user("3/second;10/day")
def settings_song_change_mp3(v):
file = request.files['file']
if file.content_type != 'audio/mpeg':
@ -699,8 +699,8 @@ def settings_song_change_mp3(v):
@app.post("/settings/song_change")
@feature_required('USERS_PROFILE_SONG')
@limiter.limit("3/second;10/day")
@ratelimit_user("3/second;10/day")
@auth_required
@ratelimit_user("3/second;10/day")
def settings_song_change(v):
song=request.values.get("song").strip()

View File

@ -25,7 +25,7 @@ def rdrama(id, title):
@app.get("/marseys")
@auth_required
def marseys(v):
def marseys(v:User):
marseys = get_marseys(g.db)
authors = get_accounts_dict([m.author_id for m in marseys], graceful=True, include_shadowbanned=False)
original = os.listdir("/asset_submissions/marseys/original")
@ -61,13 +61,13 @@ def get_emojis(db:scoped_session):
@app.get('/sidebar')
@auth_desired
def sidebar(v):
def sidebar(v:Optional[User]):
return render_template('sidebar.html', v=v)
@app.get("/stats")
@auth_required
def participation_stats(v):
def participation_stats(v:User):
if v.client: return stats_cached()
return render_template("stats.html", v=v, title="Content Statistics", data=stats_cached())
@ -81,12 +81,12 @@ def chart():
@app.get("/weekly_chart")
@auth_required
def weekly_chart(v):
def weekly_chart(v:User):
return send_file(statshelper.chart_path(kind="weekly", site=SITE))
@app.get("/daily_chart")
@auth_required
def daily_chart(v):
def daily_chart(v:User):
return send_file(statshelper.chart_path(kind="daily", site=SITE))
@app.get("/patrons")
@ -102,18 +102,15 @@ def patrons(v):
@app.get("/admins")
@app.get("/badmins")
@auth_required
def admins(v):
if v.admin_level >= PERMS['VIEW_SORTED_ADMIN_LIST']:
admins = g.db.query(User).filter(User.admin_level>1).order_by(User.truescore.desc()).all()
admins += g.db.query(User).filter(User.admin_level==1).order_by(User.truescore.desc()).all()
else: admins = g.db.query(User).filter(User.admin_level>0).order_by(User.truescore.desc()).all()
def admins(v:User):
admins = g.db.query(User).filter(User.admin_level >= PERMS['ADMIN_MOP_VISIBLE']).order_by(User.truescore.desc()).all()
return render_template("admins.html", v=v, admins=admins)
@app.get("/log")
@app.get("/modlog")
@auth_required
def log(v):
def log(v:User):
try: page = max(int(request.values.get("page", 1)), 1)
except: page = 1
@ -176,7 +173,7 @@ def log_item(id, v):
@app.get("/directory")
@auth_required
def static_megathread_index(v):
def static_megathread_index(v:User):
return render_template("megathread_index.html", v=v)
@app.get("/api")
@ -190,13 +187,13 @@ def api(v):
@app.get("/press")
@app.get("/media")
@auth_desired
def contact(v):
def contact(v:Optional[User]):
return render_template("contact.html", v=v)
@app.post("/send_admin")
@limiter.limit("1/second;1/2 minutes;10/day")
@ratelimit_user("1/second;1/2 minutes;10/day")
@auth_required
@ratelimit_user("1/second;1/2 minutes;10/day")
def submit_contact(v):
body = request.values.get("message")
if not body: abort(400)
@ -317,7 +314,7 @@ def badge_list(site):
@app.get("/badges")
@feature_required('BADGES')
@auth_required
def badges(v):
def badges(v:User):
badges, counts = badge_list(SITE)
return render_template("badges.html", v=v, badges=badges, counts=counts)
@ -338,7 +335,7 @@ def blocks(v):
@app.get("/banned")
@auth_required
def banned(v):
def banned(v:User):
users = g.db.query(User).filter(User.is_banned > 0, User.unban_utc == 0)
if not v.can_see_shadowbanned:
users = users.filter(User.shadowbanned == None)
@ -347,12 +344,12 @@ def banned(v):
@app.get("/formatting")
@auth_required
def formatting(v):
def formatting(v:User):
return render_template("formatting.html", v=v)
@app.get("/app")
@auth_desired
def mobile_app(v):
def mobile_app(v:Optional[User]):
return render_template("app.html", v=v)
@app.get("/service-worker.js")
@ -380,7 +377,7 @@ def transfers_id(id, v):
@app.get("/transfers")
@auth_required
def transfers(v):
def transfers(v:User):
comments = g.db.query(Comment).filter(Comment.author_id == AUTOJANNY_ID, Comment.parent_submission == None, Comment.body_html.like("%</a> has transferred %")).order_by(Comment.id.desc())

View File

@ -107,7 +107,7 @@ def unexile(v, sub, uid):
@app.post("/h/<sub>/block")
@auth_required
def block_sub(v, sub):
def block_sub(v:User, sub):
sub = get_sub_by_name(sub).name
existing = g.db.query(SubBlock).filter_by(user_id=v.id, sub=sub).one_or_none()
@ -121,7 +121,7 @@ def block_sub(v, sub):
@app.post("/h/<sub>/unblock")
@auth_required
def unblock_sub(v, sub):
def unblock_sub(v:User, sub):
sub = get_sub_by_name(sub).name
if sub == "chudrama" and not v.can_see_chudrama: abort(403)
block = g.db.query(SubBlock).filter_by(user_id=v.id, sub=sub).one_or_none()
@ -135,7 +135,7 @@ def unblock_sub(v, sub):
@app.post("/h/<sub>/subscribe")
@auth_required
def subscribe_sub(v, sub):
def subscribe_sub(v:User, sub):
sub = get_sub_by_name(sub).name
existing = g.db.query(SubJoin).filter_by(user_id=v.id, sub=sub).one_or_none()
@ -148,7 +148,7 @@ def subscribe_sub(v, sub):
@app.post("/h/<sub>/unsubscribe")
@auth_required
def unsubscribe_sub(v, sub):
def unsubscribe_sub(v:User, sub):
sub = get_sub_by_name(sub).name
subscribe = g.db.query(SubJoin).filter_by(user_id=v.id, sub=sub).one_or_none()
@ -160,7 +160,7 @@ def unsubscribe_sub(v, sub):
@app.post("/h/<sub>/follow")
@auth_required
def follow_sub(v, sub):
def follow_sub(v:User, sub):
sub = get_sub_by_name(sub)
if sub.name == "chudrama" and not v.can_see_chudrama: abort(403)
existing = g.db.query(SubSubscription).filter_by(user_id=v.id, sub=sub.name).one_or_none()
@ -173,7 +173,7 @@ def follow_sub(v, sub):
@app.post("/h/<sub>/unfollow")
@auth_required
def unfollow_sub(v, sub):
def unfollow_sub(v:User, sub):
sub = get_sub_by_name(sub)
subscription = g.db.query(SubSubscription).filter_by(user_id=v.id, sub=sub.name).one_or_none()
if subscription:
@ -184,7 +184,7 @@ def unfollow_sub(v, sub):
@app.get("/h/<sub>/mods")
@auth_required
def mods(v, sub):
def mods(v:User, sub):
sub = get_sub_by_name(sub)
if sub.name == "chudrama" and not v.can_see_chudrama: abort(403)
users = g.db.query(User, Mod).join(Mod).filter_by(sub=sub.name).order_by(Mod.created_utc).all()
@ -194,7 +194,7 @@ def mods(v, sub):
@app.get("/h/<sub>/exilees")
@auth_required
def sub_exilees(v, sub):
def sub_exilees(v:User, sub):
sub = get_sub_by_name(sub)
if sub.name == "chudrama" and not v.can_see_chudrama: abort(403)
users = g.db.query(User, Exile).join(Exile, Exile.user_id==User.id) \
@ -206,7 +206,7 @@ def sub_exilees(v, sub):
@app.get("/h/<sub>/blockers")
@auth_required
def sub_blockers(v, sub):
def sub_blockers(v:User, sub):
sub = get_sub_by_name(sub)
if sub.name == "chudrama" and not v.can_see_chudrama: abort(403)
users = g.db.query(User, SubBlock).join(SubBlock) \
@ -219,7 +219,7 @@ def sub_blockers(v, sub):
@app.get("/h/<sub>/followers")
@auth_required
def sub_followers(v, sub):
def sub_followers(v:User, sub):
sub = get_sub_by_name(sub)
if sub.name == "chudrama" and not v.can_see_chudrama: abort(403)
users = g.db.query(User, SubSubscription).join(SubSubscription) \
@ -232,8 +232,8 @@ def sub_followers(v, sub):
@app.post("/h/<sub>/add_mod")
@limiter.limit("1/second;30/day")
@ratelimit_user("1/second;30/day")
@is_not_permabanned
@ratelimit_user("1/second;30/day")
def add_mod(v, sub):
if SITE_NAME == 'WPD': abort(403)
sub = get_sub_by_name(sub).name
@ -457,8 +457,8 @@ def get_sub_css(sub):
@app.post("/h/<sub>/banner")
@limiter.limit("1/second;10/day")
@ratelimit_user("1/second;10/day")
@is_not_permabanned
@ratelimit_user("1/second;10/day")
def sub_banner(v, sub):
if g.is_tor: abort(403, "Image uploads are not allowed through TOR.")
@ -490,8 +490,8 @@ def sub_banner(v, sub):
@app.post("/h/<sub>/sidebar_image")
@limiter.limit("1/second;10/day")
@ratelimit_user("1/second;10/day")
@is_not_permabanned
@ratelimit_user("1/second;10/day")
def sub_sidebar(v, sub):
if g.is_tor: abort(403, "Image uploads are not allowed through TOR.")
@ -522,8 +522,8 @@ def sub_sidebar(v, sub):
@app.post("/h/<sub>/marsey_image")
@limiter.limit("1/second;10/day")
@ratelimit_user("1/second;10/day")
@is_not_permabanned
@ratelimit_user("1/second;10/day")
def sub_marsey(v, sub):
if g.is_tor: abort(403, "Image uploads are not allowed through TOR.")
@ -554,7 +554,7 @@ def sub_marsey(v, sub):
@app.get("/holes")
@auth_required
def subs(v):
def subs(v:User):
subs = g.db.query(Sub, func.count(Submission.sub)).outerjoin(Submission, Sub.name == Submission.sub).group_by(Sub.name).order_by(func.count(Submission.sub).desc()).all()
total_users = g.db.query(User).count()
return render_template('sub/subs.html', v=v, subs=subs, total_users=total_users)
@ -699,7 +699,7 @@ def mod_unpin(cid, v):
@app.get("/h/<sub>/log")
@app.get("/h/<sub>/modlog")
@auth_required
def hole_log(v, sub):
def hole_log(v:User, sub):
sub = get_sub_by_name(sub)
if sub.name == "chudrama" and not v.can_see_chudrama: abort(403)
try: page = max(int(request.values.get("page", 1)), 1)

View File

@ -56,25 +56,25 @@ def upvoters_downvoters(v, username, uid, cls, vote_cls, vote_dir, template, sta
@app.get("/@<username>/upvoters/<uid>/posts")
@auth_required
def upvoters_posts(v, username, uid):
def upvoters_posts(v:User, username, uid):
return upvoters_downvoters(v, username, uid, Submission, Vote, 1, "userpage/voted_posts.html", None)
@app.get("/@<username>/upvoters/<uid>/comments")
@auth_required
def upvoters_comments(v, username, uid):
def upvoters_comments(v:User, username, uid):
return upvoters_downvoters(v, username, uid, Comment, CommentVote, 1, "userpage/voted_comments.html", True)
@app.get("/@<username>/downvoters/<uid>/posts")
@auth_required
def downvoters_posts(v, username, uid):
def downvoters_posts(v:User, username, uid):
return upvoters_downvoters(v, username, uid, Submission, Vote, -1, "userpage/voted_posts.html", None)
@app.get("/@<username>/downvoters/<uid>/comments")
@auth_required
def downvoters_comments(v, username, uid):
def downvoters_comments(v:User, username, uid):
return upvoters_downvoters(v, username, uid, Comment, CommentVote, -1, "userpage/voted_comments.html", True)
def upvoting_downvoting(v, username, uid, cls, vote_cls, vote_dir, template, standalone):
@ -107,25 +107,25 @@ def upvoting_downvoting(v, username, uid, cls, vote_cls, vote_dir, template, sta
@app.get("/@<username>/upvoting/<uid>/posts")
@auth_required
def upvoting_posts(v, username, uid):
def upvoting_posts(v:User, username, uid):
return upvoting_downvoting(v, username, uid, Submission, Vote, 1, "userpage/voted_posts.html", None)
@app.get("/@<username>/upvoting/<uid>/comments")
@auth_required
def upvoting_comments(v, username, uid):
def upvoting_comments(v:User, username, uid):
return upvoting_downvoting(v, username, uid, Comment, CommentVote, 1, "userpage/voted_comments.html", True)
@app.get("/@<username>/downvoting/<uid>/posts")
@auth_required
def downvoting_posts(v, username, uid):
def downvoting_posts(v:User, username, uid):
return upvoting_downvoting(v, username, uid, Submission, Vote, -1, "userpage/voted_posts.html", None)
@app.get("/@<username>/downvoting/<uid>/comments")
@auth_required
def downvoting_comments(v, username, uid):
def downvoting_comments(v:User, username, uid):
return upvoting_downvoting(v, username, uid, Comment, CommentVote, -1, "userpage/voted_comments.html", True)
def user_voted(v, username, cls, vote_cls, template, standalone):
@ -158,19 +158,19 @@ def user_voted(v, username, cls, vote_cls, template, standalone):
@app.get("/@<username>/voted/posts")
@auth_required
def user_voted_posts(v, username):
def user_voted_posts(v:User, username):
return user_voted(v, username, Submission, Vote, "userpage/voted_posts.html", None)
@app.get("/@<username>/voted/comments")
@auth_required
def user_voted_comments(v, username):
def user_voted_comments(v:User, username):
return user_voted(v, username, Comment, CommentVote, "userpage/voted_comments.html", True)
@app.get("/grassed")
@auth_required
def grassed(v):
def grassed(v:User):
users = g.db.query(User).filter(User.ban_reason.like('grass award used by @%'))
if not v.can_see_shadowbanned:
users = users.filter(User.shadowbanned == None)
@ -179,7 +179,7 @@ def grassed(v):
@app.get("/chuds")
@auth_required
def chuds(v):
def chuds(v:User):
users = g.db.query(User).filter(User.agendaposter == 1)
if not v.can_see_shadowbanned:
users = users.filter(User.shadowbanned == None)
@ -233,32 +233,30 @@ def all_upvoters_downvoters(v, username, vote_dir, is_who_simps_hates):
@app.get("/@<username>/upvoters")
@auth_required
def upvoters(v, username):
def upvoters(v:User, username):
return all_upvoters_downvoters(v, username, 1, False)
@app.get("/@<username>/downvoters")
@auth_required
def downvoters(v, username):
def downvoters(v:User, username):
return all_upvoters_downvoters(v, username, -1, False)
@app.get("/@<username>/upvoting")
@auth_required
def upvoting(v, username):
def upvoting(v:User, username):
return all_upvoters_downvoters(v, username, 1, True)
@app.get("/@<username>/downvoting")
@auth_required
def downvoting(v, username):
def downvoting(v:User, username):
return all_upvoters_downvoters(v, username, -1, True)
@app.post("/@<username>/suicide")
@feature_required('USERS_SUICIDE')
@limiter.limit("1/second;5/day")
@ratelimit_user("1/second;5/day")
@auth_required
@ratelimit_user("1/second;5/day")
def suicide(v, username):
user = get_user(username)
suicide = f"Hi there,\n\nA [concerned user](/id/{v.id}) reached out to us about you.\n\nWhen you're in the middle of something painful, it may feel like you don't have a lot of options. But whatever you're going through, you deserve help and there are people who are here for you.\n\nThere are resources available in your area that are free, confidential, and available 24/7:\n\n- Call, Text, or Chat with Canada's [Crisis Services Canada](https://www.crisisservicescanada.ca/en/)\n- Call, Email, or Visit the UK's [Samaritans](https://www.samaritans.org/)\n- Text CHAT to America's [Crisis Text Line](https://www.crisistextline.org/) at 741741.\nIf you don't see a resource in your area above, the moderators keep a comprehensive list of resources and hotlines for people organized by location. Find Someone Now\n\nIf you think you may be depressed or struggling in another way, don't ignore it or brush it aside. Take yourself and your feelings seriously, and reach out to someone.\n\nIt may not feel like it, but you have options. There are people available to listen to you, and ways to move forward.\n\nYour fellow users care about you and there are people who want to help."
if not v.shadowbanned:
@ -268,7 +266,7 @@ def suicide(v, username):
@app.get("/@<username>/coins")
@auth_required
def get_coins(v, username):
def get_coins(v:User, username):
user = get_user(username, v=v, include_shadowbanned=False)
return {"coins": user.coins}
@ -328,13 +326,13 @@ def transfer_bux(v, username):
@app.get("/leaderboard")
@auth_required
def leaderboard(v):
def leaderboard(v:User):
users = g.db.query(User)
if not v.can_see_shadowbanned:
users = users.filter(User.shadowbanned == None)
coins = Leaderboard("Coins", "coins", "coins", "Coins", None, Leaderboard.get_simple_lb, User.coins, v, lambda u:u.coins, g.db, users)
subscribers = Leaderboard("Followers", "followers", "followers", "Followers", None, Leaderboard.get_simple_lb, User.stored_subscriber_count, v, lambda u:u.stored_subscriber_count, g.db, users)
subscribers = Leaderboard("Followers", "followers", "followers", "Followers", "followers", Leaderboard.get_simple_lb, User.stored_subscriber_count, v, lambda u:u.stored_subscriber_count, g.db, users)
posts = Leaderboard("Posts", "post count", "posts", "Posts", "", Leaderboard.get_simple_lb, User.post_count, v, lambda u:u.post_count, g.db, users)
comments = Leaderboard("Comments", "comment count", "comments", "Comments", "comments", Leaderboard.get_simple_lb, User.comment_count, v, lambda u:u.comment_count, g.db, users)
received_awards = Leaderboard("Awards", "received awards", "awards", "Awards", None, Leaderboard.get_simple_lb, User.received_award_count, v, lambda u:u.received_award_count, g.db, users)
@ -342,14 +340,16 @@ def leaderboard(v):
truescore = Leaderboard("Truescore", "truescore", "truescore", "Truescore", None, Leaderboard.get_simple_lb, User.truescore, v, lambda u:u.truescore, g.db, users)
badges = Leaderboard("Badges", "badges", "badges", "Badges", None, Leaderboard.get_badge_marsey_lb, Badge.user_id, v, None, g.db, None)
marseys = Leaderboard("Marseys", "Marseys made", "marseys", "Marseys", None, Leaderboard.get_badge_marsey_lb, Marsey.author_id, v, None, g.db, None) if SITE_NAME == 'rDrama' else None
blocks = Leaderboard("Blocked", "most blocked", "blocked", "Blocked By", "blockers", Leaderboard.get_blockers_lb, UserBlock.target_id, v, None, g.db, None)
owned_hats = Leaderboard("Owned hats", "owned hats", "owned-hats", "Owned Hats", None, Leaderboard.get_hat_lb, User.owned_hats, v, None, g.db, None)
designed_hats = Leaderboard("Designed hats", "designed hats", "designed-hats", "Designed Hats", None, Leaderboard.get_hat_lb, User.designed_hats, v, None, g.db, None)
leaderboards = [coins, coins_spent, truescore, subscribers, posts, comments, received_awards, badges, marseys, blocks, owned_hats, designed_hats]
leaderboards = [coins, coins_spent, truescore, subscribers, posts, comments, received_awards, badges, blocks, owned_hats]
if SITE == 'rdrama.net':
leaderboards.append(Leaderboard("Designed hats", "designed hats", "designed-hats", "Designed Hats", None, Leaderboard.get_hat_lb, User.designed_hats, v, None, g.db, None))
leaderboards.append(Leaderboard("Marseys", "Marseys made", "marseys", "Marseys", None, Leaderboard.get_badge_marsey_lb, Marsey.author_id, v, None, g.db, None))
return render_template("leaderboard.html", v=v, leaderboards=leaderboards)
@ -414,8 +414,8 @@ def unsubscribe(v, post_id):
@app.post("/@<username>/message")
@limiter.limit("1/second;10/minute;20/hour;50/day")
@ratelimit_user("1/second;10/minute;20/hour;50/day")
@is_not_permabanned
@ratelimit_user("1/second;10/minute;20/hour;50/day")
def message2(v, username):
user = get_user(username, v=v, include_blocks=True, include_shadowbanned=False)
@ -479,8 +479,8 @@ def message2(v, username):
@app.post("/reply")
@limiter.limit("1/second;6/minute;50/hour;200/day")
@ratelimit_user("1/second;6/minute;50/hour;200/day")
@auth_required
@ratelimit_user("1/second;6/minute;50/hour;200/day")
def messagereply(v):
body = sanitize_raw_body(request.values.get("body"), False)
if not body and not request.files.get("file"): abort(400, "Message is empty!")
@ -624,25 +624,40 @@ def redditor_moment_redirect(username, v):
@auth_required
def followers(username, v):
u = get_user(username, v=v, include_shadowbanned=False)
if u.id == CARP_ID and SITE == 'watchpeopledie.tv': abort(403)
if not (v.id == u.id or v.admin_level >= PERMS['USER_FOLLOWS_VISIBLE']):
abort(403)
try: page = int(request.values.get("page", 1))
except: page = 1
users = g.db.query(Follow, User).join(Follow, Follow.target_id == u.id) \
.filter(Follow.user_id == User.id) \
.order_by(Follow.created_utc).all()
return render_template("userpage/followers.html", v=v, u=u, users=users)
.order_by(Follow.created_utc.desc()) \
.offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE + 1).all()
next_exists = (len(users) > PAGE_SIZE)
users = users[:PAGE_SIZE]
return render_template("userpage/followers.html", v=v, u=u, users=users, page=page, next_exists=next_exists)
@app.get("/@<username>/blockers")
@auth_required
def blockers(username, v):
u = get_user(username, v=v, include_shadowbanned=False)
try: page = int(request.values.get("page", 1))
except: page = 1
users = g.db.query(UserBlock, User).join(UserBlock, UserBlock.target_id == u.id) \
.filter(UserBlock.user_id == User.id) \
.order_by(UserBlock.created_utc).all()
return render_template("userpage/blockers.html", v=v, u=u, users=users)
.order_by(UserBlock.created_utc.desc()) \
.offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE + 1).all()
next_exists = (len(users) > PAGE_SIZE)
users = users[:PAGE_SIZE]
return render_template("userpage/blockers.html", v=v, u=u, users=users, page=page, next_exists=next_exists)
@app.get("/@<username>/following")
@auth_required
@ -651,18 +666,33 @@ def following(username, v):
if not (v.id == u.id or v.admin_level >= PERMS['USER_FOLLOWS_VISIBLE']):
abort(403)
try: page = int(request.values.get("page", 1))
except: page = 1
users = g.db.query(User).join(Follow, Follow.user_id == u.id) \
.filter(Follow.target_id == User.id) \
.order_by(Follow.created_utc).all()
return render_template("userpage/following.html", v=v, u=u, users=users)
.order_by(Follow.created_utc.desc()) \
.offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE + 1).all()
@app.get("/views")
next_exists = (len(users) > PAGE_SIZE)
users = users[:PAGE_SIZE]
return render_template("userpage/following.html", v=v, u=u, users=users, page=page, next_exists=next_exists)
@app.get("/@<username>/views")
@auth_required
def visitors(v):
if not v.viewers_recorded:
return render_template("errors/patron.html", v=v)
viewers=sorted(v.viewers, key = lambda x: x.last_view_utc, reverse=True)
return render_template("userpage/viewers.html", v=v, viewers=viewers)
def visitors(username, v:User):
u = get_user(username, v=v, include_shadowbanned=False)
try: page = int(request.values.get("page", 1))
except: page = 1
views = g.db.query(ViewerRelationship).filter_by(user_id=u.id).order_by(ViewerRelationship.last_view_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE + 1).all()
next_exists = (len(views) > PAGE_SIZE)
views = views[:PAGE_SIZE]
return render_template("userpage/views.html", v=v, u=u, views=views, next_exists=next_exists, page=page)
@cache.memoize(timeout=86400)
def userpagelisting(user:User, site=None, v=None, page:int=1, sort="new", t="all"):
@ -684,7 +714,7 @@ def u_username(username, v=None):
return redirect(SITE_FULL + request.full_path.replace(username, u.username))
is_following = v and u.has_follower(v)
if v and v.id not in (u.id, DAD_ID) and u.viewers_recorded:
if v and v.id != u.id:
g.db.flush()
view = g.db.query(ViewerRelationship).filter_by(viewer_id=v.id, user_id=u.id).one_or_none()
@ -935,7 +965,7 @@ def user_profile_name(username):
return redirect(x.profile_url)
def get_saves_and_subscribes(v, template, relationship_cls, page:int, standalone=False):
if relationship_cls in [SaveRelationship, Subscription]:
if relationship_cls in {SaveRelationship, Subscription}:
query = relationship_cls.submission_id
join = relationship_cls.post
cls = Submission
@ -965,7 +995,7 @@ def get_saves_and_subscribes(v, template, relationship_cls, page:int, standalone
@app.get("/@<username>/saved/posts")
@auth_required
def saved_posts(v, username):
def saved_posts(v:User, username):
try: page = max(1, int(request.values.get("page", 1)))
except: abort(400, "Invalid page input!")
@ -973,7 +1003,7 @@ def saved_posts(v, username):
@app.get("/@<username>/saved/comments")
@auth_required
def saved_comments(v, username):
def saved_comments(v:User, username):
try: page = max(1, int(request.values.get("page", 1)))
except: abort(400, "Invalid page input!")
@ -981,7 +1011,7 @@ def saved_comments(v, username):
@app.get("/@<username>/subscribed/posts")
@auth_required
def subscribed_posts(v, username):
def subscribed_posts(v:User, username):
try: page = max(1, int(request.values.get("page", 1)))
except: abort(400, "Invalid page input!")
@ -989,7 +1019,7 @@ def subscribed_posts(v, username):
@app.post("/fp/<fp>")
@auth_required
def fp(v, fp):
def fp(v:User, fp):
v.fp = fp
users = g.db.query(User).filter(User.fp == fp, User.id != v.id).all()
if users: print(f'{v.username}: fp', flush=True)
@ -1035,7 +1065,7 @@ def toggle_holes():
@app.get("/badge_owners/<bid>")
@auth_required
def bid_list(v, bid):
def bid_list(v:User, bid):
try: bid = int(bid)
except: abort(400)
@ -1097,7 +1127,7 @@ kofi_tiers={
@app.post("/settings/kofi")
@limiter.limit(DEFAULT_RATELIMIT_SLOWER)
@auth_required
def settings_kofi(v):
def settings_kofi(v:User):
if not KOFI_TOKEN or KOFI_TOKEN == DEFAULT_CONFIG_VALUE: abort(404)
if not (v.email and v.is_activated):
abort(400, f"You must have a verified email to verify {patron} status and claim your rewards!")

View File

@ -42,7 +42,7 @@ def vote_info_get(v, link):
def vote_post_comment(target_id, new, v, cls, vote_cls):
if new == "-1" and DISABLE_DOWNVOTES: abort(403)
if new not in ["-1", "0", "1"]: abort(400)
if new not in {"-1", "0", "1"}: abort(400)
if v.client and v.id not in PRIVILEGED_USER_BOTS: abort(403)
new = int(new)
target = None

View File

@ -21,7 +21,7 @@ def calc_users(v):
if g.is_api_or_xhr:
g.loggedin_counter = 0
g.loggedout_counter = 0
return
return ''
loggedin = cache.get(f'{SITE}_loggedin') or {}
loggedout = cache.get(f'{SITE}_loggedout') or {}
timestamp = int(time.time())

View File

@ -43,7 +43,7 @@
<ul class="nav post-nav py-2">
<li class="nav-item">
<a class="nav-link {% if request.path.endswith('/posts') %} active{% endif %}" href="{{request.path.replace('/posts','/comments')}}">
<a class="nav-link {% if request.path.endswith('/posts') %} active{% endif %}" href="{{request.path.replace('/comments','/posts')}}">
<div>Posts</div>
</a>
</li>

View File

@ -8,7 +8,7 @@
<div class="settings-section rounded">
<div class="d-lg-flex">
<div class="title w-lg-25">
<label for="over18"><a href="{{app.permalink}}" {% if v and v.newtab %}data-target="t"target="_blank"{% endif %}>{{app.app_name}}</a></label>
<label for="over18"><a href="{{app.permalink}}/posts" {% if v and v.newtab %}data-target="t"target="_blank"{% endif %}>{{app.app_name}}</a></label>
</div>
<div class="body w-lg-100">

View File

@ -438,6 +438,10 @@
<button type="button" style="margin-top:0.2rem" class="btn caction py-0 nobackground px-1 text-muted" data-bs-toggle="dropdown" aria-expanded="false"><i class="fas fa-ellipsis-h fa-fw"></i></button>
<ul class="dropdown-menu">
{% if v.admin_level >= PERMS['APPS_MODERATION'] and c.oauth_app %}
<a href="{{c.oauth_app.permalink}}/comments" class="dropdown-item list-inline-item d-mob-none text-primary"><i class="fas fa-code text-primary fa-fw"></i>API App</a>
{% endif %}
{% if v.admin_level >= PERMS['POST_COMMENT_DISTINGUISH'] and (v.id == c.author_id or v.admin_level >= PERMS['POST_COMMENT_MODERATION']) %}
<button type="button" id="undistinguish-{{c.id}}" class="dropdown-item list-inline-item d-none {% if c.distinguish_level %}d-md-block{% endif %} text-info" onclick="postToastSwitch(this,'/distinguish_comment/{{c.id}}','distinguish-{{c.id}}','undistinguish-{{c.id}}','d-md-block')"><i class="fas fa-id-badge text-info fa-fw"></i>Undistinguish</button>
<button type="button" id="distinguish-{{c.id}}" class="dropdown-item list-inline-item d-none {% if not c.distinguish_level %}d-md-block{% endif %} text-info" onclick="postToastSwitch(this,'/distinguish_comment/{{c.id}}','distinguish-{{c.id}}','undistinguish-{{c.id}}','d-md-block')"><i class="fas fa-id-badge text-info fa-fw"></i>Distinguish</button>
@ -482,7 +486,7 @@
{% endif %}
{% if c.parent_submission and (c.author_id==v.id or v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or (c.post.sub and v.mods(c.post.sub))) %}
<button type="button" id="unmark-{{c.id}}" class="dropdown-item list-inline-item d-none {% if c.over_18 %}d-md-block{% endif %} text-danger" onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark-{{c.id}}','unmark-{{c.id}}','d-md-block')"><i class="fas fa-eye-evil text-danger fa-fw"></i>Unmark +18</button>
<button type="button" id="unmark-{{c.id}}" class="dropdown-item list-inline-item d-none {% if c.over_18 %}d-md-block{% endif %} text-success" onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark-{{c.id}}','unmark-{{c.id}}','d-md-block')"><i class="fas fa-eye-evil text-success fa-fw"></i>Unmark +18</button>
<button type="button" id="mark-{{c.id}}" class="dropdown-item list-inline-item d-none {% if not c.over_18 %}d-md-block{% endif %} text-danger" onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark-{{c.id}}','unmark-{{c.id}}','d-md-block')"><i class="fas fa-eye-evil text-danger fa-fw"></i>Mark +18</button>
{% endif %}
@ -496,9 +500,6 @@
<button type="button" id="chud-{{c.fullname}}" class="dropdown-item list-inline-item d-none {% if not c.author.agendaposter %}d-md-block{% endif %} text-danger" data-bs-toggle="modal" data-bs-target="#chudModal" onclick="chudModal('/comment/{{c.id}}', '{{c.author.id}}', '{{c.author_name}}', '{{c.fullname}}','d-md-block')"><i class="fas fa-face-sleeping text-danger fa-fw"></i>Chud user</button>
{% endif %}
{% if v.admin_level >= PERMS['APPS_MODERATION'] and c.oauth_app %}
<a href="{{c.oauth_app.permalink}}/comments" class="dropdown-item list-inline-item d-mob-none text-primary"><i class="fas fa-code text-primary fa-fw"></i>API App</a>
{% endif %}
</ul>
{% endif %}
</li>
@ -651,7 +652,7 @@
{% if c.author_id == v.id or (c.post.sub and v.mods(c.post.sub)) %}
<button type="button" id="mark2-{{c.id}}" class="{% if c.over_18 %}d-none{% endif %} list-group-item text-danger" onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark2-{{c.id}}','unmark2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye-evil text-danger mr-2"></i>Mark +18</button>
<button type="button" id="unmark2-{{c.id}}" class="{% if not c.over_18 %}d-none{% endif %} list-group-item text-danger" onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark2-{{c.id}}','unmark2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye-evil text-danger mr-2"></i>Unmark +18</button>
<button type="button" id="unmark2-{{c.id}}" class="{% if not c.over_18 %}d-none{% endif %} list-group-item text-success" onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark2-{{c.id}}','unmark2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye-evil text-success mr-2"></i>Unmark +18</button>
{% endif %}
{% if v.admin_level < PERMS['POST_COMMENT_MODERATION'] %}
@ -696,6 +697,10 @@
<div class="modal-body">
<ul class="list-group comment-actions">
{% if c.parent_submission %}
{% if v.admin_level >= PERMS['APPS_MODERATION'] and c.oauth_app %}
<a href="{{c.oauth_app.permalink}}/comments" class="list-group-item text-info"><i class="fas fa-code text-info mr-2"></i>API App</a>
{% endif %}
{% if v.id == c.author_id %}
<button type="button" id="distinguish2-{{c.id}}" class="list-group-item {% if c.distinguish_level %}d-none{% endif %} text-info" onclick="postToastSwitch(this,'/distinguish_comment/{{c.id}}','distinguish2-{{c.id}}','undistinguish2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-id-badge text-info mr-2"></i>Distinguish</button>
<button type="button" id="undistinguish2-{{c.id}}" class="list-group-item {% if not c.distinguish_level %}d-none{% endif %} text-info" onclick="postToastSwitch(this,'/distinguish_comment/{{c.id}}','distinguish2-{{c.id}}','undistinguish2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-id-badge text-info mr-2"></i>Undistinguish</button>
@ -705,7 +710,7 @@
<button type="button" id="unpin2-{{c.id}}" class="list-group-item {% if not c.stickied %}d-none{% endif %} text-info" data-bs-target="#adminModal-{{c.id}}" onclick="postToastSwitch(this,'/unsticky_comment/{{c.id}}','pin2-{{c.id}}','unpin2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-info mr-2"></i>Unpin</button>
<button type="button" id="mark2-{{c.id}}" class="{% if c.over_18 %}d-none{% endif %} list-group-item text-danger" onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark2-{{c.id}}','unmark2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye-evil text-danger mr-2"></i>Mark +18</button>
<button type="button" id="unmark2-{{c.id}}" class="{% if not c.over_18 %}d-none{% endif %} list-group-item text-danger" onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark2-{{c.id}}','unmark2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye-evil text-danger mr-2"></i>Unmark +18</button>
<button type="button" id="unmark2-{{c.id}}" class="{% if not c.over_18 %}d-none{% endif %} list-group-item text-success" onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark2-{{c.id}}','unmark2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye-evil text-success mr-2"></i>Unmark +18</button>
{% endif %}
{% if v.id != c.author_id and v.admin_level >= PERMS['USER_BAN'] %}
@ -722,10 +727,6 @@
<button type="button" id="remove2-{{c.id}}" class="{% if c.is_banned %}d-none{% endif %} list-group-item text-danger" onclick="removeComment(this,'{{c.id}}','approve2-{{c.id}}','remove2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-ban text-danger mr-2"></i>Remove</button>
<button type="button" id="approve2-{{c.id}}" class="{% if not c.is_banned and request.path != '/admin/reported/comments' %}d-none{% endif %} list-group-item text-success" onclick="approveComment(this,'{{c.id}}','approve2-{{c.id}}','remove2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-check text-success mr-2"></i>Approve</button>
{% endif %}
{% if c.oauth_app and v.admin_level >= PERMS['APPS_MODERATION'] %}
<a href="{{c.oauth_app.permalink}}/comments" class="list-group-item text-info"><i class="fas fa-code text-info mr-2"></i>API App</a>
{% endif %}
</ul>
</div>
</div>

View File

@ -5,7 +5,7 @@
<div class="overflow-x-auto">
<table class="table table-striped mb-5">
<tbody>
{% if v and v.truescore >= TRUESCORE_DONATE_LIMIT %}
{% if v and v.truescore >= TRUESCORE_DONATE_MINIMUM %}
<tr>
<td>Kofi</td>
<td><a rel="nofollow noopener" href="{{KOFI_LINK}}">{{KOFI_LINK}}</a></td>

View File

@ -5,7 +5,7 @@
<div class="overflow-x-auto">
<table class="table table-striped mb-5">
<tbody>
{% if v and v.truescore >= TRUESCORE_DONATE_LIMIT %}
{% if v and v.truescore >= TRUESCORE_DONATE_MINIMUM %}
<tr>
<td>Gumroad</td>
<td><a rel="nofollow noopener" href="{{GUMROAD_LINK}}">{{GUMROAD_LINK}}</a></td>

View File

@ -11,7 +11,7 @@
<h5 class=" mt-1">{{code}} {{title}}</h5>
<p class="text-muted error-description">{{msg|safe}}</p>
{% if details -%}
<blockquote class="error-details mb-5 py-2">{{details|safe}}</blockquote>
<blockquote class="error-details mb-4 py-2">{{details|safe}}</blockquote>
{%- endif %}
<div><a href="/" class="btn btn-primary">Go to frontpage</a></div>
</div>

View File

@ -4,10 +4,10 @@
{% block content %}
<div class="row justify-content-center">
<div class="col col-md-5">
<div class="text-center px-3 mt-5">
<div class="text-center px-3 mt-3">
<img alt=":#marseytwerking:" loading="lazy" src="/e/marseytwerking.webp">
<h5>Are you over 18?</h5>
<p class="mb-5">This post is rated +18 (Adult-Only). You must be 18 or older to continue. Are you sure you want to proceed?</p>
<p class="mb-3">This post is rated +18 (Adult-Only). You must be 18 or older to continue. Are you sure you want to proceed?</p>
<div class="btn-toolbar justify-content-center mb-4">
<form action="/allow_nsfw" method="post">

View File

@ -1,21 +0,0 @@
{% extends "default.html" %}
{% block pagetitle %}401 Not Authorized{% endblock %}
{% block pagetype %}error-401{% endblock %}
{% block content %}
<div class="row justify-content-center">
<div class="col-10 col-md-5">
<div class="text-center px-3 my-8">
<img alt=":#marseymerchant:" loading="lazy" class="mb-2" src="/e/marseymerchant.webp">
<h5>401 Not Authorized</h5>
<p class="text-muted">This page is only available to {% if SITE_NAME == 'rDrama' %}paypigs{% else %}patrons{% endif %}:</p>
{% if FEATURES['MARSEYBUX'] and v.truescore -%}
{% if KOFI_LINK %}
<a rel="nofollow noopener" href="{{KOFI_LINK}}">{{KOFI_LINK}}</a>
{% else %}
<a rel="nofollow noopener" href="{{GUMROAD_LINK}}">{{GUMROAD_LINK}}</a>
{% endif %}
{%- endif %}
</div>
</div>
</div>
{% endblock %}

View File

@ -175,7 +175,7 @@
float: left;
font-size: 14px;
padding-top: 0.25rem;
padding-right: 0.25rem;
padding-right: 0.7rem;
}
</style>

View File

@ -70,7 +70,7 @@
<div class="rounded border bg-white mx-auto">
{% for ma in actions %}
<div id="action-{{ma.id}}" class="{% if ma.unread %}unread{% endif %} position-relative d-flex justify-content-between flex-wrap align-items-center h-min-16 px-3 py-3 bg-white{% if loop.index > 1 %} border-top{% endif %}">
<div id="action-{{ma.id}}" class="modlog-action{% if ma.unread %} unread{% endif %}">
<div class="d-flex flex-grow-1 align-items-center">
<div class="d-flex align-items-center justify-content-center {{ma.color}} mr-3 rounded-lg flex-shrink-0" style="width: 32px;height: 32px;"><i class="far text-center {{ma.icon}} text-lg text-white fa-fw"></i></div>
<div class="d-flex align-items-center">

View File

@ -1,5 +1,5 @@
{% if v and v.id==p.author_id and p.private %}
<form action="/publish/{{p.id}}" method="post">
<form action="/publish/{{p.id}}" method="post" class="d-flex">
<input type="hidden" name="formkey", value="{{v|formkey}}">
<button type="submit" class="list-inline-item text-small p-0 m-0 mr-3 border-0 nobackground font-weight-bold" type="submit" onclick="disable(this)"><i class="fas fa-globe"></i>Publish</button>
</form>
@ -40,6 +40,10 @@
{% if v %}
<button type="button" class="list-inline-item" data-bs-toggle="dropdown" aria-expanded="false"><i class="fas fa-ellipsis-h fa-fw"></i></button>
<ul class="dropdown-menu">
{% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] and p.oauth_app %}
<a class="dropdown-item list-inline-item text-info" href="{{p.oauth_app.permalink}}/posts"><i class="fas fa-code"></i>API App</a>
{% endif %}
{% if v.admin_level >= PERMS['POST_COMMENT_DISTINGUISH'] %}
<button type="button" id="distinguish-{{p.id}}" class="dropdown-item {% if p.distinguish_level %}d-none{% endif %} list-inline-item text-info" onclick="postToastSwitch(this,'/distinguish/{{p.id}}','distinguish-{{p.id}}','undistinguish-{{p.id}}','d-none')"><i class="fas fa-crown"></i>Distinguish</button>
<button type="button" id="undistinguish-{{p.id}}" class="dropdown-item {% if not p.distinguish_level %}d-none{% endif %} list-inline-item text-info" onclick="postToastSwitch(this,'/distinguish/{{p.id}}','distinguish-{{p.id}}','undistinguish-{{p.id}}','d-none')"><i class="fas fa-crown"></i>Undistinguish</button>
@ -63,10 +67,6 @@
{% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %}
<button type="button" id="remove-{{p.id}}" class="dropdown-item {% if p.is_banned %}d-none{% endif %} list-inline-item text-danger" onclick="removePost(this,'{{p.id}}','remove-{{p.id}}','approve-{{p.id}}','d-none')"><i class="fas fa-ban"></i>Remove</button>
<button type="button" id="approve-{{p.id}}" class="dropdown-item {% if not p.is_banned and request.path != '/admin/reported/posts' %}d-none{% endif %} list-inline-item text-success" onclick="approvePost(this,'{{p.id}}','remove-{{p.id}}','approve-{{p.id}}','d-none')"><i class="fas fa-check"></i>Approve</button>
{% if p.oauth_app %}
<a class="dropdown-item list-inline-item" href="{{p.oauth_app.permalink}}"><i class="fas fa-code"></i>API App</a>
{% endif %}
{% endif %}

View File

@ -28,8 +28,8 @@
<button type="button" id="unsave2-{{p.id}}" class="{% if not p.id in v.saved_idlist %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-muted" onclick="postToastSwitch(this,'/unsave_post/{{p.id}}','save2-{{p.id}}','unsave2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-save text-center text-muted mr-2"></i>Unsave</button>
{% if p.sub and v.mods(p.sub) %}
<button type="button" id="hole-pin2-{{p.id}}" class="{% if p.hole_pinned %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-muted" onclick="postToastSwitch(this,'/hole_pin/{{p.id}}','hole-pin2-{{p.id}}','hole-unpin2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-center text-muted mr-2"></i>Pin to /h/{{p.sub}}</button>
<button type="button" id="hole-unpin2-{{p.id}}" class="{% if not p.hole_pinned %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-muted" onclick="postToastSwitch(this,'/hole_unpin/{{p.id}}','hole-pin2-{{p.id}}','hole-unpin2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-center text-muted mr-2"></i>Unpin from /h/{{p.sub}}</button>
<button type="button" id="hole-pin2-{{p.id}}" class="{% if p.hole_pinned %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-info" onclick="postToastSwitch(this,'/hole_pin/{{p.id}}','hole-pin2-{{p.id}}','hole-unpin2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-center text-info mr-2"></i>Pin to /h/{{p.sub}}</button>
<button type="button" id="hole-unpin2-{{p.id}}" class="{% if not p.hole_pinned %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-info" onclick="postToastSwitch(this,'/hole_unpin/{{p.id}}','hole-pin2-{{p.id}}','hole-unpin2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-center text-info mr-2"></i>Unpin from /h/{{p.sub}}</button>
{% endif %}
{% if v.id==p.author_id %}

View File

@ -9,6 +9,10 @@
</div>
<div class="modal-body">
<ul class="list-group post-actions">
{% if v.admin_level >= PERMS['APPS_MODERATION'] and p.oauth_app %}
<a href="{{p.oauth_app.permalink}}/posts" class="nobackground btn btn-link btn-block btn-lg text-muted text-left text-info"><i class="far fa-code text-center text-info mr-2"></i>API App</a>
{% endif %}
{% if (request.path.startswith('/post/') or request.path.startswith('/h/')) and v.admin_level >= PERMS['POST_EDITING'] and p.id %}
<button type="button" class="nobackground btn btn-link btn-block btn-lg text-left text-muted" data-bs-dismiss="modal" onclick="togglePostEdit('{{p.id}}')"><i class="far fa-edit text-center text-muted mr-2"></i>Edit</button>
{% endif %}
@ -28,12 +32,9 @@
<button type="button" id="remove2-{{p.id}}" class="{% if p.is_banned %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-danger text-left" onclick="removePost(this,'{{p.id}}','remove2-{{p.id}}','approve2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="far fa-ban text-center mr-2"></i>Remove</button>
<button type="button" id="approve2-{{p.id}}" class="{% if not p.is_banned and request.path != '/admin/reported/posts' %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-success text-left" onclick="approvePost(this,'{{p.id}}','remove2-{{p.id}}','approve2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="far fa-check text-center mr-2"></i>Approve</button>
{% endif %}
{% if p.oauth_app and v.admin_level >= PERMS['APPS_MODERATION'] %}
<a href="{{p.oauth_app.permalink}}"><button type="button" class="nobackground btn btn-link btn-block btn-lg text-muted text-left"><i class="far fa-code text-center text-info mr-2"></i>API App</button></a>
{% endif %}
{% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %}
<button type="button" id="mark2-{{p.id}}" class="{% if p.over_18 %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-danger" onclick="postToastSwitch(this,'/toggle_post_nsfw/{{p.id}}','mark2-{{p.id}}','unmark2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="far fa-eye-evil text-center text-danger mr-2"></i>Mark +18</button>
<button type="button" id="unmark2-{{p.id}}" class="{% if not p.over_18 %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-danger" onclick="postToastSwitch(this,'/toggle_post_nsfw/{{p.id}}','mark2-{{p.id}}','unmark2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="far fa-eye-evil text-center text-danger mr-2"></i>Unmark +18</button>
<button type="button" id="unmark2-{{p.id}}" class="{% if not p.over_18 %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-success" onclick="postToastSwitch(this,'/toggle_post_nsfw/{{p.id}}','mark2-{{p.id}}','unmark2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="far fa-eye-evil text-center text-success mr-2"></i>Unmark +18</button>
{% endif %}
{% if v.id != p.author_id and v.admin_level >= PERMS['USER_BAN'] %}
<button type="button" id="ban2-{{p.fullname}}" data-bs-dismiss="modal" data-bs-toggle="modal" data-bs-target="#banModal" onclick="banModal('/post/{{p.id}}', '{{p.author.id}}', '{{p.author_name}}', '{{p.fullname}}','d-none')" class="{% if p.author.is_suspended %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-danger text-left"><i class="fas fa-user-minus mr-2"></i>Ban user</button>

View File

@ -25,7 +25,7 @@
</div>
<div class="body w-lg-100">
<p>You're a {{TIERS_ID_TO_NAME[v.patron] if v.patron else "freeloader"}}!</p>{% if v.patron %} Thanks ily! &lt;3{% endif %}
{% if not v.patron and v.truescore >= TRUESCORE_DONATE_LIMIT %}
{% if not v.patron and v.truescore >= TRUESCORE_DONATE_MINIMUM %}
<p class="font-italic">To stop freeloading, first <a href="/settings/security#new_email">verify your email</a>, support us on <a href="{{DONATE_LINK}}">{{DONATE_SERVICE}}</a> with the same email, and click "Claim {{patron}} Rewards"</p>
{% elif not v.patron %}
<p class="font-italic">To stop freeloading, you can <a href="/donate">donate via crypto</a>. Please let us know first beforehand by <a href="/contact">sending us a modmail.</a> Thanks!</p>
@ -57,7 +57,7 @@
<p>Change the background for the website.</p>
<div class="input-group mb2">
<select autocomplete="off" id='backgroundSelector' class="form-control" form="profile-settings" name="background" onchange="updatebgselection();">
{% for entry in ["anime", "fantasy", "solarpunk", "pixelart"] %}
{% for entry in BACKGROUND_CATEGORIES %}
<option value="{{entry}}" {% if v.background and v.background.startswith(entry) %}selected{% endif %}>
{{entry}}
</option>

View File

@ -50,7 +50,7 @@
</div>
{% if FEATURES['MARSEYBUX'] %}
<span class="text-small text-muted pl-1">Must be same email as the one you used to donate
{% if v.truescore >= TRUESCORE_DONATE_LIMIT %}
{% if v.truescore >= TRUESCORE_DONATE_MINIMUM %}
on
{% if KOFI_TOKEN %}
<a rel="nofollow noopener" class="text-primary" href="{{KOFI_LINK}}">Kofi</a>

View File

@ -102,9 +102,5 @@
</div>
</div>
{% block mobilenavbar %}{% include "mobile_navigation_bar.html" %}{% endblock %}
{% block invitationModal %}{% endblock %}
{% block exileModal %}{% endblock %}
{% block approveModal %}{% endblock %}
{% block errorToasts %}{% endblock %}
{% block scripts %}{% endblock %}
{% endblock %}

View File

@ -54,8 +54,28 @@
{%- endif %}
<div class="sidebar--rules">
<h3 class="sidebar--rules-head mt-4 mb-3">Rules</h3>
<ol class="sidebar--rules-list sidebar--rules-list--rdrama">
<p>Drama: any incident, scene, gaffe, rumor, opinion, or disagreement that is blown entirely out of proportion.</p>
<p><strong>Do your part to keep our community healthy by blowing everything out of proportion and making literally everything as dramatic as possible.</strong></p>
<p>rdrama.net caters to drama in all forms such as: <strong>Real life, videos, photos, gossip, rumors, news sites, Reddit, and Beyond™</strong>. There isn't drama we won't touch, and we want it all.</p>
<h3>What we want:</h3>
<ul>
<li>Arguments.</li>
<li>Gossip.</li>
<li>Scandals.</li>
<li>Lolcows.</li>
<li>Assholes.</li>
<li>Trainwrecks.</li>
<li>Meltdowns.</li>
<li>Dramatic news articles.</li>
<li>Dramatic rumours (with context).</li>
<li>Dramatic everything from <strong>anywhere</strong></li>
</ul>
<h3>A couple things to remember:</h3>
<ul>
<li class="font-weight-bold" style="color: red"><a href="/post/19711/a-short-guide-on-how-to" style="color: inherit">NO RIGHTWING AGENDAPOSTING.</a></li>
<li>Don't post anything illegal.</li>
<li>No sexualizing minors.</li>
@ -67,8 +87,44 @@
<li class="font-weight-bold">Absolutely NO misgendering.</li>
<li class="font-weight-bold">Absolutely NO antisemitism.</li>
<li class="font-weight-bold">Absolutely NO vaccine misinformation.</li>
</ol>
<p class="font-italic text-small">This is an entertainment comedy website. Any and all posts and comments are parody with no basis in reality.</p>
<li>You are encouraged to post drama you are involved in.</li>
<li>This is a mod playground.</li>
<li>Participation implies enthusiastic consent to being mod abused by unstable alcoholic bullies.</li>
</ul>
<h3>Related subreddits:</h3>
<ul>
<li><a href="https://old.reddit.com/r/AgainstHateSubreddits">/r/AgainstHateSubreddits</a><br></li>
<li><a href="https://old.reddit.com/r/SubredditDrama">/r/SubredditDrama</a><br></li>
<li><a href="https://old.reddit.com/r/HobbyDrama">/r/HobbyDrama</a><br></li>
<li><a href="https://old.reddit.com/r/internetdrama">/r/internetdrama</a><br></li>
<li><a href="https://old.reddit.com/r/youtubedrama">/r/youtubedrama</a><br></li>
<li><a href="https://old.reddit.com/r/facebookdrama">/r/facebookdrama</a><br></li>
<li><a href="https://old.reddit.com/r/theElon">/r/theElon</a><br></li>
<li><a href="https://old.reddit.com/r/BanVideoGames">/r/BanVideoGames</a><br></li>
<li><a href="https://old.reddit.com/r/LoveForLandlords">/r/LoveForLandlords</a><br></li>
<li><a href="https://old.reddit.com/r/LoveForAnimesexuals">/r/LoveForAnimesexuals</a><br></li>
<li><a href="https://old.reddit.com/r/LoveForScalpers">/r/LoveForScalpers</a><br></li>
<li><a href="https://old.reddit.com/r/MelvinCapitalLove">/r/MelvinCapitalLove</a><br></li>
<li><a href="https://old.reddit.com/r/banime">/r/banime</a><br></li>
<li><a href="https://old.reddit.com/r/LoveForAmazon">/r/LoveForAmazon</a><br></li>
<li><a href="https://old.reddit.com/r/LoveForDronePilots">/r/LoveForDronePilots</a><br></li>
</ul>
<h3>Off-site drama whoring websites:</h3>
<ul>
<li><a href="https://ohnotheydidnt.livejournal.com">ONTD</a></li>
<li><a href="https://radaronline.com">Radar Online</a></li>
<li><a href="https://tmz.com">TMZ</a></li>
<li><a href="https://encyclopediadramatica.online">Encyclopedia Dramatica</a></li>
<li><a href="https://4chan.org">4Chan</a></li>
<li><a href="https://twitter.com">Twitter</a></li>
<li><a href="https://8kun.top">8Chan</a></li>
<li><a href="https://lolcow.farm/">Lolcow.farm</a></li>
<li><a href="https://lmgtfy.com/?q=local+news+website">Your local shitty news website</a></li>
</ul>
<p class="font-italic text-small mt-4">This is an entertainment comedy website. Any and all posts and comments are parody with no basis in reality.</p>
<p style="color: hotpink">𝐜𝐚𝐫𝐩 𝐰𝐨𝐳 𝐞𝐫𝐞</p>
</div>
{% endif %}

View File

@ -245,17 +245,17 @@
{% endif %}
{% if p.is_image and not p.over_18 and ((v and v.cardview) or (not v and CARD_VIEW)) %}
<div style="text-align: center" class="mt-3 mb-4">
<div class="ml-5 mt-3 mb-4">
<a {% if v and v.newtab %}data-target="t"target="_blank"{% endif %} rel="nofollow noopener" href="{{p.realurl(v)}}">
<img loading="lazy" data-src="{{p.realurl(v)}}" src="/i/l.webp" class="img-fluid" style="max-height:20rem" alt="Unable to load image">
</a>
</div>
{% elif p.is_video %}
<div id="video-{{p.id}}" style="text-align: center" class="{% if p.over_18 or not ((v and v.cardview) or (not v and CARD_VIEW)) %}d-none{% endif %} mt-4">
<div id="video-{{p.id}}" class="ml-5 {% if p.over_18 or not ((v and v.cardview) or (not v and CARD_VIEW)) %}d-none{% endif %} mt-4">
<video id="video2-{{p.id}}" controls preload="none" src="{{p.realurl(v)}}"></video>
</div>
{% elif p.is_audio %}
<div id="video-{{p.id}}" style="text-align: center" class="{% if p.over_18 or not ((v and v.cardview) or (not v and CARD_VIEW)) %}d-none{% endif %} mt-4">
<div id="video-{{p.id}}" class="ml-5 {% if p.over_18 or not ((v and v.cardview) or (not v and CARD_VIEW)) %}d-none{% endif %} mt-4">
<audio id="video2-{{p.id}}" controls preload="none" src="{{p.realurl(v)}}"></audio>
</div>
{% elif p.is_youtube %}

View File

@ -70,7 +70,9 @@
{% endif %}
{% if v and (v.id == u.id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']) -%}
<div class="font-weight-bolder mb-2" id="profile--simphate"><a class="mr-1" href="/@{{u.username}}/upvoters">Simps</a> | <a class="mx-1" href="/@{{u.username}}/downvoters">Haters</a> | <a class="mx-1" href="/@{{u.username}}/upvoting">Simps For</a> | <a class="mx-1" href="/@{{u.username}}/downvoting">Hates</a> | <a class="ml-1" href="/@{{u.username}}/voted/posts">Voted</a></div>
<div class="font-weight-bolder mb-2" id="profile--simphate">
<a class="mr-1" href="/@{{u.username}}/views">Profile Views</a> | <a class="mx-1" href="/@{{u.username}}/upvoters">Simps</a> | <a class="mx-1" href="/@{{u.username}}/downvoters">Haters</a> | <a class="mx-1" href="/@{{u.username}}/upvoting">Simps For</a> | <a class="mx-1" href="/@{{u.username}}/downvoting">Hates</a> | <a class="ml-1" href="/@{{u.username}}/voted/posts">Voted</a>
</div>
{%- endif %}
<div class="font-weight-bolder">
@ -188,7 +190,6 @@
<div class="actionbtns">
{% if v and v.id == u.id %}
<a href="/settings/personal" class="btn btn-secondary">Edit profile</a>
<a href="/views" class="btn btn-secondary">Profile views</a>
{% endif %}
{% if FEATURES['USERS_PROFILE_SONG'] and u.song and v and (v.id == u.id or v.mute and not u.unmutable) %}
@ -196,7 +197,7 @@
{% endif %}
</div>
<div class="mt-2" id="profile--info">
<div class="mt-3" id="profile--info">
<p id="profile--info--id">User ID: {{u.id}}</p>
<p id="profile--info--spent">Coins spent: {{u.coins_spent}}</p>
<p id="profile--info--truescore">True score: {{u.truescore}}</p>
@ -302,7 +303,9 @@
{% endif %}
{% if v and (v.id == u.id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']) -%}
<div class="font-weight-bolder mb-2" id="profile-mobile--simphate"><a class="mr-1" href="/@{{u.username}}/upvoters">Simps</a> | <a class="mx-1" href="/@{{u.username}}/downvoters">Haters</a> | <a class="mx-1" href="/@{{u.username}}/upvoting">Simps For</a> | <a class="mx-1" href="/@{{u.username}}/downvoting">Hates</a> | <a class="ml-1" href="/@{{u.username}}/voted/posts">Voted</a></div>
<div class="font-weight-bolder mb-2" id="profile-mobile--simphate">
<a class="mr-1" href="/@{{u.username}}/views">Profile Views</a> | <a class="mx-1" href="/@{{u.username}}/upvoters">Simps</a> | <a class="mx-1" href="/@{{u.username}}/downvoters">Haters</a> | <a class="mx-1" href="/@{{u.username}}/upvoting">Simps For</a> | <a class="mx-1" href="/@{{u.username}}/downvoting">Hates</a> | <a class="ml-1" href="/@{{u.username}}/voted/posts">Voted</a>
</div>
{%- endif %}
<div class="font-weight-normal">
@ -385,7 +388,6 @@
<div class="actionbtns">
{% if v and v.id == u.id %}
<a href="/settings/personal" class="btn btn-secondary ">Edit profile</a>
<a href="/views" class="btn btn-secondary">Profile views</a>
{% endif %}
{% if FEATURES['USERS_PROFILE_SONG'] and u.song and v and (v.id == u.id or v.mute and not u.unmutable) %}

View File

@ -1,11 +1,10 @@
{% extends "default.html" %}
{% block pagetitle %}@{{u.username}}'s blockers{% endblock %}
{% block content %}
<h5 class="mt-3">@{{u.username}}'s blockers</h5>
<h5 class="my-3">@{{u.username}}'s blockers</h5>
<div class="overflow-x-auto mt-1"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th>#</th>
<th>Name</th>
<td>Blocking since</td>
</tr>
@ -13,7 +12,6 @@
<tbody id="blockers-table">
{% for block, user in users %}
<tr>
<td>{{loop.index}}</td>
<td>{% include "user_in_table.html" %}</td>
<td {% if block.created_utc > 1599343262 %}data-time="{{block.created_utc}}"{% endif %}></td>
</tr>
@ -24,3 +22,24 @@
<script defer src="{{'js/blockers.js' | asset}}"></script>
{% endblock %}
{% block pagenav %}
<nav aria-label="Page navigation">
<ul class="pagination pagination-sm py-3 pl-3 mb-0">
{% if page>1 %}
<li class="page-item">
<small><a class="page-link" href="?page={{page-1}}" tabindex="-1">Prev</a></small>
</li>
{% else %}
<li class="page-item disabled"><span class="page-link">Prev</span></li>
{% endif %}
{% if next_exists %}
<li class="page-item">
<small><a class="page-link" href="?page={{page+1}}">Next</a></small>
</li>
{% else %}
<li class="page-item disabled"><span class="page-link">Next</span></li>
{% endif %}
</ul>
</nav>
{% endblock %}

View File

@ -1,11 +1,10 @@
{% extends "default.html" %}
{% block pagetitle %}@{{u.username}}'s followers{% endblock %}
{% block content %}
<h5 class="mt-2">@{{u.username}}'s followers</h5>
<h5 class="my-3">@{{u.username}}'s followers</h5>
<div class="overflow-x-auto mt-1"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th>#</th>
<th>Name</th>
<td>Following since</td>
{% if v.id == u.id %}
@ -16,7 +15,6 @@
<tbody id="followers-table">
{% for follow, user in users %}
<tr>
<td>{{loop.index}}</td>
<td>{% include "user_in_table.html" %}</td>
<td {% if follow.created_utc > 1599343262 %}data-time="{{follow.created_utc}}"{% endif %}></td>
{% if v.id == u.id %}
@ -30,3 +28,24 @@
<script defer src="{{'js/followers.js' | asset}}"></script>
{% endblock %}
{% block pagenav %}
<nav aria-label="Page navigation">
<ul class="pagination pagination-sm py-3 pl-3 mb-0">
{% if page>1 %}
<li class="page-item">
<small><a class="page-link" href="?page={{page-1}}" tabindex="-1">Prev</a></small>
</li>
{% else %}
<li class="page-item disabled"><span class="page-link">Prev</span></li>
{% endif %}
{% if next_exists %}
<li class="page-item">
<small><a class="page-link" href="?page={{page+1}}">Next</a></small>
</li>
{% else %}
<li class="page-item disabled"><span class="page-link">Next</span></li>
{% endif %}
</ul>
</nav>
{% endblock %}

View File

@ -1,11 +1,10 @@
{% extends "default.html" %}
{% block pagetitle %}Users followed by @{{u.username}}{% endblock %}
{% block content %}
<h5 class="mt-3 mb-1">Users followed by @{{u.username}}</h5>
<h5 class="my-3">Users followed by @{{u.username}}</h5>
<div class="overflow-x-auto"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th>#</th>
<th>Name</th>
{% if v.id == u.id %}
<th></th>
@ -15,7 +14,6 @@
<tbody id="followers-table">
{% for user in users %}
<tr>
<td>{{loop.index}}</td>
<td>{% include "user_in_table.html" %}</td>
{% if v.id == u.id %}
<td><div class="btn btn-danger" onclick="removeFollowing(this, '{{user.username}}')">Unfollow</div></td>
@ -28,3 +26,24 @@
<script defer src="{{'js/following.js' | asset}}"></script>
{% endblock %}
{% block pagenav %}
<nav aria-label="Page navigation">
<ul class="pagination pagination-sm py-3 pl-3 mb-0">
{% if page>1 %}
<li class="page-item">
<small><a class="page-link" href="?page={{page-1}}" tabindex="-1">Prev</a></small>
</li>
{% else %}
<li class="page-item disabled"><span class="page-link">Prev</span></li>
{% endif %}
{% if next_exists %}
<li class="page-item">
<small><a class="page-link" href="?page={{page+1}}">Next</a></small>
</li>
{% else %}
<li class="page-item disabled"><span class="page-link">Next</span></li>
{% endif %}
</ul>
</nav>
{% endblock %}

View File

@ -1,24 +0,0 @@
{% extends "default.html" %}
{% block pagetitle %}Profile Viewers{% endblock %}
{% block content %}
<h5 class="pt-4 pl-2 my-1">Users who viewed your profile</h5>
<div class="overflow-x-auto"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th>Name</th>
<th>Last visit</th>
</tr>
</thead>
{% for view in viewers %}
<tr>
<td>
{% with user=view.viewer %}
{% include "user_in_table.html" %}
{% endwith %}
</td>
<td>{{view.last_view_string}}</td>
</tr>
{% endfor %}
</table>
{% endblock %}

View File

@ -0,0 +1,45 @@
{% extends "default.html" %}
{% block pagetitle %}Profile Views{% endblock %}
{% block content %}
<h5 class="pt-4 pl-2 pb-3">Users who viewed @{{u.username}}'s profile</h5>
<div class="overflow-x-auto"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th>Name</th>
<th>Last visit</th>
</tr>
</thead>
{% for view in views %}
<tr>
<td>
{% with user=view.viewer %}
{% include "user_in_table.html" %}
{% endwith %}
</td>
<td>{{view.last_view_string}}</td>
</tr>
{% endfor %}
</table>
{% endblock %}
{% block pagenav %}
<nav aria-label="Page navigation">
<ul class="pagination pagination-sm py-3 pl-3 mb-0">
{% if page>1 %}
<li class="page-item">
<small><a class="page-link" href="?page={{page-1}}" tabindex="-1">Prev</a></small>
</li>
{% else %}
<li class="page-item disabled"><span class="page-link">Prev</span></li>
{% endif %}
{% if next_exists %}
<li class="page-item">
<small><a class="page-link" href="?page={{page+1}}">Next</a></small>
</li>
{% else %}
<li class="page-item disabled"><span class="page-link">Next</span></li>
{% endif %}
</ul>
</nav>
{% endblock %}

View File

@ -13,6 +13,6 @@
</div>
</div>
</div>
{% endif %}
{% endif %}
</div>
{% endblock %}

View File

@ -1,7 +1,7 @@
{% extends "default.html" %}
{% block pagetitle %}{{name2}}{% endblock %}
{% block content %}
<h3 class="mt-3" style="text-align: center">{{name2}}</h3>
<h3 class="my-3" style="text-align: center">{{name2}}</h3>
<h5 class="font-weight-bold text-center mt-3">Total: {{total}}</h5>
<div class="mt-1 overflow-x-auto"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">

View File

@ -1,37 +0,0 @@
from bs4 import BeautifulSoup
from time import time, sleep
from files.__main__ import app
# these tests require `docker-compose up` first
def test_rules():
response = app.test_client().get("/sidebar")
assert response.status_code == 200
assert response.text.startswith("<!DOCTYPE html>")
def test_signup():
client = app.test_client()
with client: # this keeps the session between requests, which we need
signup_get_response = client.get("/signup")
assert signup_get_response.status_code == 200
soup = BeautifulSoup(signup_get_response.text, 'html.parser')
# these hidden input values seem to be used for anti-bot purposes and need to be submitted
formkey = next(tag for tag in soup.find_all("input") if tag.get("name") == "formkey").get("value")
form_timestamp = next(tag for tag in soup.find_all("input") if tag.get("name") == "now").get("value")
sleep(5) # too-fast submissions are rejected (bot check?)
username = "testuser" + str(round(time()))
signup_post_response = client.post("/signup", data={
"username": username,
"password": "password",
"password_confirm": "password",
"email": "",
"formkey": formkey,
"now": form_timestamp
})
print(f"Signing up as {username}", flush=True)
assert signup_post_response.status_code == 302
assert "error" not in signup_post_response.location
# we should now be logged in and able to post

View File

@ -28,7 +28,6 @@ tldextract
user-agents
psycopg2-binary
pusher_push_notifications
pytest
youtube-dl
yattag
webptools

View File

@ -395,7 +395,8 @@ CREATE TABLE public.comments (
wordle_result character varying(115),
body_ts tsvector GENERATED ALWAYS AS (to_tsvector('english'::regconfig, (body)::text)) STORED,
casino_game_id integer,
chuddedfor character varying(40)
chuddedfor character varying(40),
stickied_child_id integer
);
@ -2466,6 +2467,14 @@ ALTER TABLE ONLY public.save_relationship
ADD CONSTRAINT save_relationship_user_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) MATCH FULL;
--
-- Name: comments stickied_child_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.comments
ADD CONSTRAINT stickied_child_fkey FOREIGN KEY (stickied_child_id) REFERENCES public.comments(id);
--
-- Name: sub_blocks sub_blocks_sub_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

View File

@ -226,6 +226,7 @@ SET row_security = off;
--
INSERT INTO public.hat_defs VALUES (716, 'Baked Beans Bucket Hat', 'This neighbor is wearing beans!', 2, 500, NULL, 1663647585);
INSERT INTO public.hat_defs VALUES (1002, 'Hearty Hands', 'I dont think hands should do that...', 2, 500, NULL, 1667084251);
INSERT INTO public.hat_defs VALUES (1003, 'Dragged', 'HELLLLLLLLLLPPPPPPPPPPPPPPPPP', 2, 500, NULL, 1667084272);
INSERT INTO public.hat_defs VALUES (718, 'Literally Me', 'Sving music, jazz? PTOOEY!', 2, 500, NULL, 1663801724);
@ -623,6 +624,7 @@ INSERT INTO public.hat_defs VALUES (1074, 'Scottish Sticky Note', 'idk why its s
INSERT INTO public.hat_defs VALUES (1076, 'Snow Globe', 'Snow globe full of partially transparent webp flakes', 2, 1000, NULL, 1668755503);
INSERT INTO public.hat_defs VALUES (1075, 'Jerma Approval', 'Who? What? I haven''t understood a hat submission in so fucking long', 2, 1000, NULL, 1668727612);
INSERT INTO public.hat_defs VALUES (1079, 'Spinning Christmas Elf Hat', 'It''s time to go green.', 2, 1000, NULL, 1668755556);
INSERT INTO public.hat_defs VALUES (1100, 'World Cup Mascot', 'This user supports the 2022 World Cup and watched it for Jungkook!', 2, 500, NULL, 1669007389);
INSERT INTO public.hat_defs VALUES (874, 'Carp', 'My 100th hat and a Thank you to carp. Now 150 more!', 2, 500, NULL, 1665272718);
INSERT INTO public.hat_defs VALUES (1077, 'Premium Snow Globe', 'Snow globe with a more premium base.', 2, 1000, NULL, 1668755505);
INSERT INTO public.hat_defs VALUES (93, 'Wizard I', 'Three decades a KHHV', 2, 500, NULL, 1662167687);
@ -1168,7 +1170,7 @@ INSERT INTO public.hat_defs VALUES (911, 'Racecar Hat', 'I sleep in a hat with m
-- Name: hat_defs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('public.hat_defs_id_seq', 1099, true);
SELECT pg_catalog.setval('public.hat_defs_id_seq', 1103, true);
--
@ -1202,6 +1204,7 @@ INSERT INTO public.marseys (name, author_id, tags, created_utc) VALUES
('marsey1984',2,'orwell book ingsoc big brother fascist',NULL),
('marsey300',2,'leonidas shield armor thermopylae spear greek spartan',NULL),
('marsey3d',2,'poly 3d print alive spin animated',NULL),
('marsey403',2,'error http unauthorized forbidden access',1669055713),
('marsey404',2,'missing 404 error html page notfound',1668930304),
('marsey40k',2,'warhammer 40k 40000 space space marine marine ultramarine smurf',NULL),
('marsey420',2,'marijuana weed dude weed lmao ganja drugs pot reggae joint jamaican',NULL),
@ -1372,6 +1375,7 @@ INSERT INTO public.marseys (name, author_id, tags, created_utc) VALUES
('marseybiting',2,'reaction datass lip bite dat ass',NULL),
('marseyblack',2,'basketball black african american bipoc coon fade jersey sports kang gang jogger',NULL),
('marseyblack2',2,'nigger african coon ape monkey bipoc excited happy',NULL),
('marseyblackandwhite',2,'black mixed white shredded manlet cat cute',1669229303),
('marseyblackcat',2,'cat black halloween homoween',1666656250),
('marseyblackcock',2,'cock chicken poultry bbc black ride mount cowgirl',NULL),
('marseyblackcop',2,'police officer acab thin blue line pig bipoc',NULL),
@ -1585,6 +1589,7 @@ INSERT INTO public.marseys (name, author_id, tags, created_utc) VALUES
('marseychonkerbutch',2,'fat obese brap bitch dyke dangerhair lesbian',NULL),
('marseychonkerfoid',2,'female woman fds fat obese hambeast landwhale porker pig bleeder birthing person bangs',NULL),
('marseychonkerfoidpuke',2,'fat huge sick yuck eat barf',1664574968),
('marseychonkernoticeme',2,'attention fat foid annoying',1669407871),
('marseychristmas',2,'candy cane santa christmas holiday',NULL),
('marseychristmasbulb',2,'ornament christmas happy holiday china',NULL),
('marseychristmasbulb2',2,'ornament holiday christmas',NULL),
@ -2025,6 +2030,8 @@ INSERT INTO public.marseys (name, author_id, tags, created_utc) VALUES
('marseyhitler2',2,'adolf adolph nazi germany kraut axis mustache genocide dictator authright chud conservative trump',NULL),
('marseyhmm',2,'confused reaction thinking thunk thonk judgment',NULL),
('marseyhmmm',2,'confused reaction thinking thunk thonk judgment',NULL),
('marseyhobbes',2,'calvin hobbes waterson tiger comic',1669097969),
('marseyholocaust',2,'jew nazi adl merchant genocide chud rightoid hitler train auschwitz 109',1669064577),
('marseyhomestar',2,'homestar runner fast everybody 2000s',NULL),
('marseyhomochingchong',2,'asian chinese jap gook chink rice gay strawhat glasses squint rainbow tiedie tyedye tyedie tiedye',1663248780),
('marseyhomofascist',2,'lgbt faggot ss fash nazi homocracy gay queer sodomy wholesome kiss',NULL),
@ -2531,6 +2538,8 @@ INSERT INTO public.marseys (name, author_id, tags, created_utc) VALUES
('marseypusheen',2,'grey gray',NULL),
('marseypussyhat',2,'feminist feminism activism activist protester protesting foid gussy woman birthing person roasty roastie thot slut whore',NULL),
('marseyputin',2,'vladimir russian kgb moscow ukraine dictator leader',NULL),
('marseyqatarworldcup',2,'soccer football sports muslim islam allah sand bipoc robe ghost',1669146805),
('marseyqatarworldcup2',2,'soccer football sports muslim islam allah sand bipoc robe ghost',1669146826),
('marseyqoomer',2,'shaman viking qanon jan6 capitol january6',NULL),
('marseyqr',2,'qr code',1663646718),
('marseyqr2',2,'cryptographic qrcode',1663944616),
@ -2668,6 +2677,7 @@ INSERT INTO public.marseys (name, author_id, tags, created_utc) VALUES
('marseyschizochadseethecapylove',2,'animated schizo schizocel rare love chad seethe capy aevann',NULL),
('marseyschizochadthankscapylove',2,'animated schizo schizocel rare love chad thanks queen capy aevann',NULL),
('marseyschizochadyescapylove',2,'animated schizo schizocel rare love chad yes capy aevann',NULL),
('marseyschizochiobulove',2,'chink asian tangerine feline singapore',1669161511),
('marseyschizodoggilove',2,'animated schizo schizocel rare love dussy doggi',NULL),
('marseyschizodongerlove',2,'animated schizo schizocel rare love kaiser uraniumdonger donger',NULL),
('marseyschizoducklove',2,'animated schizo schizocel rare love duck',NULL),
@ -2934,6 +2944,7 @@ INSERT INTO public.marseys (name, author_id, tags, created_utc) VALUES
('marseytranspearlclutch',2,'transgender upset snowflake clutching',1666994064),
('marseytransrentfree',2,'transgender lgbt rent free wojak chud',NULL),
('marseytree',2,'tree nature outdoors cosplay',NULL),
('marseytribute',2,'cum cumshot semen ropes load facial nsfw',1669095975),
('marseytrickortreat',2,'candy trick or treat halloween holiday',NULL),
('marseytrickrtreat',2,'halloween horror mask sam',1667697001),
('marseytrogdor',2,'burninator strongbad internet meme dragon marsdor',NULL),

View File

@ -1093,7 +1093,7 @@ Yawn, another brigade from Drama? They must be tired of disrespecting the trans
{[para]}
I'm not a homosexual because I have straight sex with a man and I like men. But I'm straight because I prefer women's dicks and love having sex with them. I'm a homophobe because I can't have it.
{[para]}
Hello refugee, welcome to rDrama.net.
Hello refugee, welcome to rdrama.net.
In order to continue posting, please submit a timestamped photograph of your anus (known colloquially as 'bussy') to one of our immigration officers for detailed inspection. Failure to do so would mean immediate deportation
{[para]}
Since when is promotion of gangbang considered as "sexual threat"?
@ -1705,7 +1705,7 @@ Watch what you want, but when I can't see something like First Reformed or Portr
{[para]}
This is outrageous. My criticism of Israel has very little to do with my rabid anti-semitism.
{[para]}
This is rDrama.net sweaty.
This is rdrama.net sweaty.
You're ALL awful. I'm awful too.
You think that the mentally unstable we make fun of would be as miserable and unstable as they are without us?
They wouldn't.
@ -1719,7 +1719,7 @@ This IS horrible.
ALL of this is HORRIBLE.
And you're part of it.
Fuck you, you stupid bitch.
And fuck you all, rDrama.net. I'm out.
And fuck you all, rdrama.net. I'm out.
{[para]}
Being white and playing video games is a short pipeline that leads to learning Japanese and raping your sister
{[para]}
@ -2938,7 +2938,7 @@ I'm here to show your audience that you don't have the secret of anything, not e
Respond however you want, and I'll be back later to laugh about how once again, the angry impotent hate-ragers you all enjoy are not only sad, but ruining your life, when all you really need to do is take a shower and clean your room.
Just think about how many of you actually killed yourself and just stopped posting, while everyone else failed to notice or were simply glad you disappeared. I hope it's you next. You're all a worthless drain on society.
{[para]}
To be fair, you have to be very neurodivergent to understand rDrama.net. The bait is extremely obvious, and without a solid grasp of satire most of the jokes will go over a typical viewer's head. There's also Carp's racist outlook, which is deftly woven into his characterisation - his personal philosophy draws heavily from MDE literature, for instance. The fans understand this stuff; they have the intellectual capacity to truly appreciate the depths of these jokes, to realize that they're not just funny- they say something deep about THE INTERNET. As a consequence people who dislike rDrama truly ARE zoomers- of course they wouldn't appreciate, for instance, the humour in Janny's existential catchphrase "Y'all can't behave," which itself is a cryptic reference to Aldous Huxley's dystopian epic Brave New World. I'm smirking right now just imagining one of those seriousposting wingtards scratching their heads in confusion as Aevann's genius unfolds itself on their mobile phone screens. What fools... how I pity them. :marseylaugh: And yes by the way, I DO have a Marsey tattoo. And no, you cannot see it. It's for the ladies' eyes only- And even they have to demonstrate that they're within 5 IQ points of my own (preferably lower) beforehand.
To be fair, you have to be very neurodivergent to understand rdrama.net. The bait is extremely obvious, and without a solid grasp of satire most of the jokes will go over a typical viewer's head. There's also Carp's racist outlook, which is deftly woven into his characterisation - his personal philosophy draws heavily from MDE literature, for instance. The fans understand this stuff; they have the intellectual capacity to truly appreciate the depths of these jokes, to realize that they're not just funny- they say something deep about THE INTERNET. As a consequence people who dislike rDrama truly ARE zoomers- of course they wouldn't appreciate, for instance, the humour in Janny's existential catchphrase "Y'all can't behave," which itself is a cryptic reference to Aldous Huxley's dystopian epic Brave New World. I'm smirking right now just imagining one of those seriousposting wingtards scratching their heads in confusion as Aevann's genius unfolds itself on their mobile phone screens. What fools... how I pity them. :marseylaugh: And yes by the way, I DO have a Marsey tattoo. And no, you cannot see it. It's for the ladies' eyes only- And even they have to demonstrate that they're within 5 IQ points of my own (preferably lower) beforehand.
{[para]}
I don't know, but I'll make sure not to get on your bad side lest I begin molesting children. Like a Pascal's wager kind of thing.
{[para]}
@ -3174,3 +3174,6 @@ Normies can't understand the thrill of pinning the Weasel. Night spent chasing a
I am the “office manager” of AHS. Ive spent the past three years keeping spreadsheets and have inboxes full of ticket closures, and have written reports characterizing the response accuracy of Reddit AEO.
Would you like to escalate and mansplain my field of expertise to me more?
{[para]}
Normies can't understand the thrill of pinning the capybara. Night spent chasing an over amphetamined Aevann around the bean bag forts. His squealing and gibbering, pouring sweat and on the verge of seizing. Dramatards build up an intoxicating, delerious state with "dude bussy lmbo" chantings at the sidelines, hitting the Aevann-toy with brooms if he tries to escape. Carp would be giggling and laughing as the waves of methamphetamine pleasure seem to harmonize with the droning r-slur verses. He runs through the bean bag maze skinny and malnourished, with his viagra powered peepee a divining rod for the capybara. Sweat gushing down his, face around his unfocused eyes he laughs and chortles until he gasps "Found you!”. The Codescapybara screeches defensively but Whorist Florist is upon him in seconds. His peepee thrusting blindly into his flank, leg, stomach and ribs unconcemed about anything but the motion. Eventually serendepity finds his mouth and the Cocktube Rodent is placated, suckling contently on the Carp's dehydrated peepee.