diff --git a/files/classes/badges.py b/files/classes/badges.py index 8cc92f2270..3e9e1a3714 100644 --- a/files/classes/badges.py +++ b/files/classes/badges.py @@ -5,7 +5,7 @@ from sqlalchemy.orm import relationship from sqlalchemy.sql.sqltypes import * from files.classes import Base -from files.helpers.config.const import SITE_NAME +from files.helpers.config.const import * from files.helpers.lazy import lazy class BadgeDef(Base): @@ -26,8 +26,8 @@ class BadgeDef(Base): @property @lazy def path(self): - if 20 < self.id < 28 or self.id == 222: return f"/i/{SITE_NAME}/badges/{self.id}.webp" - return f"/i/badges/{self.id}.webp" + if 20 < self.id < 28 or self.id == 222: return SITE_FULL + f"/i/{SITE_NAME}/badges/{self.id}.webp" + return SITE_FULL + f"/i/badges/{self.id}.webp" class Badge(Base): diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 5c54435712..76461cb22f 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -51,7 +51,7 @@ def execute_snappy(post:Submission, v:User): if v.id == CARP_ID: if random.random() < 0.02: body = "i love you carp" - elif random.random() < 0.02: body = "![](/images/16614707883108485.webp)" + elif random.random() < 0.02: body = "https://i.rdrama.net/images/16614707883108485.webp" else: body = ":#marseyfuckoffcarp:" elif v.id == LAWLZ_ID: if random.random() < 0.5: body = "wow, this lawlzpost sucks!" diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index f4c987ea13..197d5b823f 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -375,7 +375,7 @@ PROFANITIES = { slur_single_words = "|".join([slur.lower() for slur in SLURS.keys()]) profanity_single_words = "|".join([profanity.lower() for profanity in PROFANITIES.keys()]) -LONGPOST_REPLIES = ('Wow, you must be a JP fan.', 'This is one of the worst posts I have EVER seen. Delete it.', "No, don't reply like this, please do another wall of unhinged rant please.", '# 😴😴😴', "Ma'am we've been over this before. You need to stop.", "I've known more coherent downies.", "Your pulitzer's in the mail", "That's great and all, but I asked for my burger without cheese.", 'That degree finally paying off', "That's nice sweaty. Why don't you have a seat in the time out corner with Pizzashill until you calm down, then you can have your Capri Sun.", "All them words won't bring your pa back.", "You had a chance to not be completely worthless, but it looks like you threw it away. At least you're consistent.", 'Some people are able to display their intelligence by going on at length on a subject and never actually saying anything. This ability is most common in trades such as politics, public relations, and law. You have impressed me by being able to best them all, while still coming off as an absolute idiot.', "You can type 10,000 characters and you decided that these were the one's that you wanted.", 'Have you owned the libs yet?', "I don't know what you said, because I've seen another human naked.", 'Impressive. Normally people with such severe developmental disabilities struggle to write much more than a sentence or two. He really has exceded our expectations for the writing portion. Sadly the coherency of his writing, along with his abilities in the social skills and reading portions, are far behind his peers with similar disabilities.', "This is a really long way of saying you don't fuck.", "Sorry ma'am, looks like his delusions have gotten worse. We'll have to admit him.", 'If only you could put that energy into your relationships', 'Posts like this is why I do Heroine.', 'still unemployed then?', 'K', 'look im gunna have 2 ask u 2 keep ur giant dumps in the toilet not in my replys 😷😷😷', "Mommy is soooo proud of you, sweaty. Let's put this sperg out up on the fridge with all your other failures.", "Good job bobby, here's a star", "That was a mistake. You're about to find out the hard way why.", 'You sat down and wrote all this shit. You could have done so many other things with your life. What happened to your life that made you decide writing novels of bullshit here was the best option?', "I don't have enough spoons to read this shit", "All those words won't bring daddy back.", 'OUT!', "Damn, you're really mad over this, but thanks for the effort you put into typing that all out! Sadly I won't read it all.", "Jesse what the fuck are you talking about??", "▼you're fucking bananas if you think I'm reading all that, take my downvote and shut up idiot", "Are you feeling okay bud?", ':#marseywoah:', 'At no point in your rambling, incoherent post were you even close to anything that could be considered a rational thought. Everyone on this site is now dumber for having read it. May God have mercy on your soul.', 'https://rdrama.net/videos/1671169024815045.mp4', '![](/images/16766675896248007.webp)') +LONGPOST_REPLIES = ('Wow, you must be a JP fan.', 'This is one of the worst posts I have EVER seen. Delete it.', "No, don't reply like this, please do another wall of unhinged rant please.", '# 😴😴😴', "Ma'am we've been over this before. You need to stop.", "I've known more coherent downies.", "Your pulitzer's in the mail", "That's great and all, but I asked for my burger without cheese.", 'That degree finally paying off', "That's nice sweaty. Why don't you have a seat in the time out corner with Pizzashill until you calm down, then you can have your Capri Sun.", "All them words won't bring your pa back.", "You had a chance to not be completely worthless, but it looks like you threw it away. At least you're consistent.", 'Some people are able to display their intelligence by going on at length on a subject and never actually saying anything. This ability is most common in trades such as politics, public relations, and law. You have impressed me by being able to best them all, while still coming off as an absolute idiot.', "You can type 10,000 characters and you decided that these were the one's that you wanted.", 'Have you owned the libs yet?', "I don't know what you said, because I've seen another human naked.", 'Impressive. Normally people with such severe developmental disabilities struggle to write much more than a sentence or two. He really has exceded our expectations for the writing portion. Sadly the coherency of his writing, along with his abilities in the social skills and reading portions, are far behind his peers with similar disabilities.', "This is a really long way of saying you don't fuck.", "Sorry ma'am, looks like his delusions have gotten worse. We'll have to admit him.", 'If only you could put that energy into your relationships', 'Posts like this is why I do Heroine.', 'still unemployed then?', 'K', 'look im gunna have 2 ask u 2 keep ur giant dumps in the toilet not in my replys 😷😷😷', "Mommy is soooo proud of you, sweaty. Let's put this sperg out up on the fridge with all your other failures.", "Good job bobby, here's a star", "That was a mistake. You're about to find out the hard way why.", 'You sat down and wrote all this shit. You could have done so many other things with your life. What happened to your life that made you decide writing novels of bullshit here was the best option?', "I don't have enough spoons to read this shit", "All those words won't bring daddy back.", 'OUT!', "Damn, you're really mad over this, but thanks for the effort you put into typing that all out! Sadly I won't read it all.", "Jesse what the fuck are you talking about??", "▼you're fucking bananas if you think I'm reading all that, take my downvote and shut up idiot", "Are you feeling okay bud?", ':#marseywoah:', 'At no point in your rambling, incoherent post were you even close to anything that could be considered a rational thought. Everyone on this site is now dumber for having read it. May God have mercy on your soul.', 'https://rdrama.net/videos/1671169024815045.mp4', 'https://i.rdrama.net/images/16766675896248007.webp') AGENDAPOSTER_PHRASE = 'trans lives matter' diff --git a/files/helpers/media.py b/files/helpers/media.py index 29b6eec112..d0aed3d519 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -57,7 +57,7 @@ def process_files(files, v, body): name = f'/images/{time.time()}'.replace('.','') + '.webp' file.save(name) url = process_image(name, v) - body = body.replace(f'[{file.filename}]', f"![]({url})", 1) + body = body.replace(f'[{file.filename}]', url, 1) elif file.content_type.startswith('video/'): body = body.replace(f'[{file.filename}]', process_video(file, v), 1) elif file.content_type.startswith('audio/'): @@ -257,9 +257,8 @@ def process_image(filename:str, v, resize=0, trim=False, uploader_id:Optional[in ) db.add(media) - if SITE == 'rdrama.net': return f'https://i.{SITE}{filename}' - return filename - + if IS_LOCALHOST: return f'![]({filename})' + return f'https://i.{SITE}{filename}' def process_dm_images(v, user, body): diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 5699c24bb0..c9f27deaee 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -295,7 +295,7 @@ def sanitize_settings_text(sanitized:Optional[str], max_length:Optional[int]=Non chud_images = listdir("files/assets/images/chud") -chud_images = [f'\n\n![](/i/chud/{f})' for f in chud_images] +chud_images = [f'\n\n{SITE_FULL}/i/chud/{f}' for f in chud_images] chud_images.extend([':#trumpjaktalking:', ':#reposthorse:']) def handle_youtube_links(url): @@ -414,7 +414,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_marseys tag["loading"] = "lazy" tag["data-src"] = tag["src"] tag["src"] = "/i/l.webp" - tag['alt'] = f'![]({tag["data-src"]})' + tag['alt'] = tag["data-src"] if tag.parent.name != 'a': a = soup.new_tag("a", href=tag["data-src"]) diff --git a/files/helpers/useractions.py b/files/helpers/useractions.py index fa46174711..c89f3d8231 100644 --- a/files/helpers/useractions.py +++ b/files/helpers/useractions.py @@ -27,4 +27,4 @@ def badge_grant(user, badge_id, description=None, url=None, notify=True): if notify: send_repeatable_notification(user.id, "@AutoJanny has given you the following profile badge:\n\n" + - f"![]({badge.path})\n\n**{badge.name}**\n\n{badge.badge.description}") + f"{badge.path}\n\n**{badge.name}**\n\n{badge.badge.description}") diff --git a/files/routes/admin.py b/files/routes/admin.py index 579924e228..1ce81a7ed0 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -469,7 +469,7 @@ def badge_grant_post(v): g.db.flush() if v.id != user.id: - text = f"@{v.username} (a site admin) has given you the following profile badge:\n\n![]({new_badge.path})\n\n**{new_badge.name}**\n\n{new_badge.badge.description}" + text = f"@{v.username} (a site admin) has given you the following profile badge:\n\n{new_badge.path}\n\n**{new_badge.name}**\n\n{new_badge.badge.description}" send_repeatable_notification(user.id, text) ma = ModAction( @@ -506,7 +506,7 @@ def badge_remove_post(v): return render_template("admin/badge_admin.html", v=v, badge_types=badges, grant=False, error="User doesn't have that badge!") if v.id != user.id: - text = f"@{v.username} (a site admin) has removed the following profile badge from you:\n\n![]({badge.path})\n\n**{badge.name}**\n\n{badge.badge.description}" + text = f"@{v.username} (a site admin) has removed the following profile badge from you:\n\n{badge.path}\n\n**{badge.name}**\n\n{badge.badge.description}" send_repeatable_notification(user.id, text) ma = ModAction( diff --git a/files/routes/chat.py b/files/routes/chat.py index 9c3de1468d..f066a54a96 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -54,7 +54,7 @@ def speak(data, v): global messages text = sanitize_raw_body(data['message'], False)[:CHAT_LENGTH_LIMIT] - if image: text += f'\n\n![]({image})' + if image: text += f'\n\n{image}' if not text: return '', 400 text_html = sanitize(text, count_marseys=True, chat=True) diff --git a/files/routes/comments.py b/files/routes/comments.py index 232e6196d7..269d06f504 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -211,7 +211,7 @@ def comment(v:User): purge_files_in_cache(f"https://{SITE}/assets/images/badges/{badge.id}.webp") except Exception as e: abort(400, str(e)) - body = body.replace(f'[{file.filename}]', f"![]({image})", 1) + body = body.replace(f'[{file.filename}]', image, 1) elif file.content_type.startswith('video/'): body = body.replace(f'[{file.filename}]', process_video(file, v), 1) elif file.content_type.startswith('audio/'): diff --git a/files/templates/admin/dm_images.html b/files/templates/admin/dm_images.html index 57e34467e2..dd0a4a7dff 100644 --- a/files/templates/admin/dm_images.html +++ b/files/templates/admin/dm_images.html @@ -17,7 +17,7 @@ - ![]({{item[0]}}) + {{item[0]}}