test getting rid of ![]( on devrama

pull/139/head
Aevann 2023-03-12 15:02:31 +02:00
parent 88835e278d
commit 97608ea0a9
10 changed files with 16 additions and 17 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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/'):

View File

@ -17,7 +17,7 @@
<tr>
<td>
<a href="{{item[0]}}" target="_blank">
<img alt="![]({{item[0]}})" src="{{item[0]}}" loading="lazy" class="dm_img">
<img alt="{{item[0]}}" src="{{item[0]}}" loading="lazy" class="dm_img">
</a>
</td>
<td>