diff --git a/files/classes/comment.py b/files/classes/comment.py index dce606f35..84b4678c5 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -199,7 +199,7 @@ class Comment(Base): @property @lazy def shortlink(self): - return f"https://{site}/comment/{self.id}" + return f"http://{site}/comment/{self.id}" @property @lazy diff --git a/files/classes/submission.py b/files/classes/submission.py index 64d470dd2..8d977ab86 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -170,7 +170,7 @@ class Submission(Base): @property @lazy def shortlink(self): - return f"https://{site}/post/{self.id}" + return f"http://{site}/post/{self.id}" @property @lazy @@ -233,11 +233,11 @@ class Submission(Base): @property @lazy def thumb_url(self): - if self.over_18: return f"https://{site}/assets/images/nsfw.gif" - elif not self.url: return f"https://{site}/assets/images/{site_name}/default_thumb_text.gif" + if self.over_18: return f"http://{site}/assets/images/nsfw.gif" + elif not self.url: return f"http://{site}/assets/images/{site_name}/default_thumb_text.gif" elif self.thumburl: return self.thumburl - elif "youtu.be" in self.domain or "youtube.com" in self.domain: return f"https://{site}/assets/images/default_thumb_yt.gif" - else: return f"https://{site}/assets/images/default_thumb_link.gif" + elif "youtu.be" in self.domain or "youtube.com" in self.domain: return f"http://{site}/assets/images/default_thumb_yt.gif" + else: return f"http://{site}/assets/images/default_thumb_link.gif" @property @lazy diff --git a/files/classes/user.py b/files/classes/user.py index 0f3bd59a5..ed1dbd6e8 100755 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -431,14 +431,14 @@ class User(Base): @lazy def banner_url(self): if self.bannerurl: return self.bannerurl - else: return f"https://{site}/assets/images/{site_name}/preview.gif" + else: return f"http://{site}/assets/images/{site_name}/preview.gif" @property @lazy def profile_url(self): if self.profileurl: return self.profileurl - elif "rama" in site: return f"https://{site}/assets/images/defaultpictures/{random.randint(1, 150)}.gif" - else: return f"https://{site}/assets/images/default-profile-pic.gif" + elif "rama" in site: return f"http://{site}/assets/images/defaultpictures/{random.randint(1, 150)}.gif" + else: return f"http://{site}/assets/images/default-profile-pic.gif" @property @lazy diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 88c4c0faf..950ae7211 100755 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -164,13 +164,13 @@ def sanitize(sanitized, noimages=False): if emoji.startswith("!"): emoji = emoji[1:] if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'): - new = re.sub(f'(?', new) + new = re.sub(f'(?', new) if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1 else: session["favorite_emojis"][emoji] = 1 elif path.isfile(f'./files/assets/images/emojis/{emoji}.webp'): - new = re.sub(f'(?', new) + new = re.sub(f'(?', new) if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1 else: session["favorite_emojis"][emoji] = 1 @@ -183,13 +183,13 @@ def sanitize(sanitized, noimages=False): if emoji.startswith("!"): emoji = emoji[1:] if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'): - sanitized = re.sub(f'(?', sanitized) + sanitized = re.sub(f'(?', sanitized) if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1 else: session["favorite_emojis"][emoji] = 1 elif path.isfile(f'./files/assets/images/emojis/{emoji}.webp'): - sanitized = re.sub(f'(?', sanitized) + sanitized = re.sub(f'(?', sanitized) if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1 else: session["favorite_emojis"][emoji] = 1 diff --git a/files/routes/comments.py b/files/routes/comments.py index c58eb731b..2c477c0d2 100755 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -525,7 +525,7 @@ def api_comment(v): 'notification': { 'title': f'New reply by @{v.username}', 'body': c.body, - 'deep_link': f'https://{site}{c.permalink}?context=10#context', + 'deep_link': f'http://{site}{c.permalink}?context=10#context', }, }, }, diff --git a/files/routes/feeds.py b/files/routes/feeds.py index f653dfeb8..1d76af10d 100755 --- a/files/routes/feeds.py +++ b/files/routes/feeds.py @@ -51,7 +51,7 @@ def feeds_user(sort='hot', t='all'): with tag("name"): text(post.author.username) with tag("uri"): - text(f'https://{site}/@{post.author.username}') + text(f'http://{site}/@{post.author.username}') doc.stag("link", href=full_link(post.permalink)) diff --git a/files/routes/posts.py b/files/routes/posts.py index 4cd72bb2d..a5665ce56 100755 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -63,7 +63,7 @@ def publish(pid, v): for follow in v.followers: user = get_account(follow.user_id) - send_notification(AUTOJANNY_ACCOUNT, user, f"@{v.username} has made a new post: [{post.title}](https://{site}{post.permalink})") + send_notification(AUTOJANNY_ACCOUNT, user, f"@{v.username} has made a new post: [{post.title}](http://{site}{post.permalink})") g.db.commit() @@ -297,7 +297,7 @@ def edit_post(pid, v): user = g.db.query(User).options(lazyload('*')).filter_by(username=username).first() if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user) - message = f"@{v.username} has mentioned you: https://{site}{p.permalink}" + message = f"@{v.username} has mentioned you: http://{site}{p.permalink}" for x in notify_users: existing = g.db.query(Comment).options(lazyload('*')).filter(Comment.author_id == NOTIFICATIONS_ACCOUNT, Comment.body == message, Comment.notifiedto == x.id).first() if not existing: send_notification(NOTIFICATIONS_ACCOUNT, x, message) @@ -349,10 +349,10 @@ def filter_title(title): if emoji.startswith("!"): emoji = emoji[1:] if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'): - title = re.sub(f'(?', title) + title = re.sub(f'(?', title) elif path.isfile(f'./files/assets/images/emojis/{emoji}.webp'): - title = re.sub(f'(?', title) + title = re.sub(f'(?', title) if len(title) > 1500: abort(400) else: return title @@ -752,12 +752,12 @@ def submit_post(v): user = g.db.query(User).options(lazyload('*')).filter_by(username=username).first() if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user) - for x in notify_users: send_notification(NOTIFICATIONS_ACCOUNT, x, f"@{v.username} has mentioned you: https://{site}{new_post.permalink}") + for x in notify_users: send_notification(NOTIFICATIONS_ACCOUNT, x, f"@{v.username} has mentioned you: http://{site}{new_post.permalink}") if not new_post.private: for follow in v.followers: user = get_account(follow.user_id) - send_notification(AUTOJANNY_ACCOUNT, user, f"@{v.username} has made a new post: [{title}](https://{site}{new_post.permalink})") + send_notification(AUTOJANNY_ACCOUNT, user, f"@{v.username} has made a new post: [{title}](http://{site}{new_post.permalink})") g.db.add(new_post) g.db.flush() @@ -879,7 +879,7 @@ def submit_post(v): cache.delete_memoized(frontlist) cache.delete_memoized(User.userpagelisting) if "[changelog]" in new_post.title or "(changelog)" in new_post.title: - send_message(f"https://{site}{new_post.permalink}") + send_message(f"http://{site}{new_post.permalink}") cache.delete_memoized(changeloglist) g.db.commit() diff --git a/files/routes/reporting.py b/files/routes/reporting.py index f9d156c85..e71dcf3f3 100755 --- a/files/routes/reporting.py +++ b/files/routes/reporting.py @@ -21,7 +21,7 @@ def api_flag_post(pid, v): for i in re.finditer(':(.{1,30}?):', reason): if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.webp'): - reason = reason.replace(f':{i.group(1)}:', f'') + reason = reason.replace(f':{i.group(1)}:', f'') flag = Flag(post_id=post.id, user_id=v.id, @@ -53,7 +53,7 @@ def api_flag_comment(cid, v): for i in re.finditer(':(.{1,30}?):', reason): if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.webp'): - reason = reason.replace(f':{i.group(1)}:', f'') + reason = reason.replace(f':{i.group(1)}:', f'') flag = CommentFlag(comment_id=comment.id, user_id=v.id, diff --git a/files/routes/static.py b/files/routes/static.py index 84531a3c6..a24ed8e9e 100755 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -228,7 +228,7 @@ def contact(v): @limiter.limit("1/second") @auth_required def submit_contact(v): - message = f'This message has been sent automatically to all admins via https://{site}/contact, user email is "{v.email}"\n\nMessage:\n\n' + request.values.get("message", "") + message = f'This message has been sent automatically to all admins via http://{site}/contact, user email is "{v.email}"\n\nMessage:\n\n' + request.values.get("message", "") send_admin(v.id, message) g.db.commit() return render_template("contact.html", v=v, msg="Your message has been sent.") diff --git a/files/routes/users.py b/files/routes/users.py index d04f471ec..d56d9b6e3 100755 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -271,7 +271,7 @@ def message2(v, username): 'notification': { 'title': f'New message from @{v.username}', 'body': message, - 'deep_link': f'https://{site}/notifications', + 'deep_link': f'http://{site}/notifications', }, }, },