From 50e9e3061a6a7455dc452ff77c847d24ae6f5dc8 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 5 Feb 2022 16:36:10 +0200 Subject: [PATCH] dfs --- files/classes/comment.py | 4 ++-- files/classes/submission.py | 6 +++--- files/templates/comments.html | 2 +- files/templates/emoji_modal.html | 2 +- files/templates/submission.html | 2 +- files/templates/submission_listing.html | 2 +- files/templates/userpage.html | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index 96d93be19..3bae7836c 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -342,7 +342,7 @@ class Comment(Base): if v.teddit: body = body.replace("old.reddit.com", "teddit.net") elif not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com") - if v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net") + if v.nitter and not '/i/spaces/' in body: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net") if v and v.controversial: for i in re.finditer('(/comments/.*?)"', body): @@ -393,7 +393,7 @@ class Comment(Base): if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com") - if v and v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net") + if v and v.nitter and not '/i/spaces/' in body: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net") if v and v.controversial: for i in re.finditer('(/comments/.*?)"', body): diff --git a/files/classes/submission.py b/files/classes/submission.py index 727f0149b..6c1eb9567 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -346,7 +346,7 @@ class Submission(Base): if v.controversial: url += "&sort=controversial" return url elif self.url: - if v and v.nitter: return self.url.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net") + if v and v.nitter and not '/i/spaces/' in self.url: return self.url.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net") if self.url.startswith('/'): return SITE_FULL + self.url return self.url else: return "" @@ -362,7 +362,7 @@ class Submission(Base): if v.teddit: body = body.replace("old.reddit.com", "teddit.net") elif not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com") - if v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net") + if v.nitter and not '/i/spaces/' in body: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net") if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 20: ti = max(int((time.time() - self.created_utc)/60), 1) @@ -418,7 +418,7 @@ class Submission(Base): if v.teddit: body = body.replace("old.reddit.com", "teddit.net") elif not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com") - if v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net") + if v.nitter and not '/i/spaces/' in body: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net") return body diff --git a/files/templates/comments.html b/files/templates/comments.html index c0b9e27dc..d09f4e68e 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -225,7 +225,7 @@ 👻 {% else %} {% if c.author.house %} - + {% endif %} {% if c.author.verified %} diff --git a/files/templates/emoji_modal.html b/files/templates/emoji_modal.html index d87e5efe5..02df375f8 100644 --- a/files/templates/emoji_modal.html +++ b/files/templates/emoji_modal.html @@ -86,7 +86,7 @@ - +