add !YOU! to post bodies and to comments

pull/24/head
Aevann1 2022-11-27 03:31:46 +02:00 committed by geese_suck
parent f4fcc4bd09
commit 1c12cbe21d
Signed by: geese_suck
GPG Key ID: 4D09E4B0A7264746
2 changed files with 13 additions and 0 deletions

View File

@ -294,6 +294,9 @@ 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
@ -309,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