From a50544d86a8a2bfa87ba02d8bd768d63edb08526 Mon Sep 17 00:00:00 2001
From: Aevann1
Date: Thu, 23 Jun 2022 00:25:10 +0200
Subject: [PATCH 1/4] fixing "more comments" button appearing when there's no
more comments
---
files/classes/comment.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/files/classes/comment.py b/files/classes/comment.py
index c08022c83c..b3f680ee48 100644
--- a/files/classes/comment.py
+++ b/files/classes/comment.py
@@ -246,7 +246,7 @@ class Comment(Base):
return self.child_comments.order_by(Comment.id).all()
comments = self.child_comments.filter(Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID)))
- return sort_comments(sort, comments)
+ return sort_comments(sort, comments).all()
@property
From 8f2c2885d2f8ed64e8cc88d09802b43e5475e7e6 Mon Sep 17 00:00:00 2001
From: Aevann1
Date: Thu, 23 Jun 2022 00:40:53 +0200
Subject: [PATCH 2/4] include psot body in reddit mentions too
---
files/helpers/offsitementions.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/files/helpers/offsitementions.py b/files/helpers/offsitementions.py
index 4e45f71bef..6865d97fdc 100644
--- a/files/helpers/offsitementions.py
+++ b/files/helpers/offsitementions.py
@@ -43,9 +43,14 @@ def get_mentions(queries):
# Special case: PokemonGoRaids says 'Marsey' a lot unrelated to us.
if i['subreddit'] == 'PokemonGoRaids': continue
+ if kind == 'comment':
+ text = f'{i["body"]}
'
+ else:
+ text = f'{i["title"]}
{i["selftext"][:5000]}
'
+
mentions.append({
'permalink': i['permalink'],
- 'text': i['body' if kind == 'comment' else 'title'],
+ 'text': text,
})
return mentions
@@ -57,8 +62,7 @@ def notify_mentions(send_to, mentions, mention_str='site mention'):
notif_text = \
f'New {mention_str}: ' \
- f'https://old.reddit.com{permalink}?context=89
' \
- f'{text}
'
+ f'https://old.reddit.com{permalink}?context=89
{text}' \
existing_comment = g.db.query(Comment.id).filter_by(
author_id=const.NOTIFICATIONS_ID,
From 175b63c02c1e6f0f62fce3f8f38720f50f7a5538 Mon Sep 17 00:00:00 2001
From: Aevann1
Date: Thu, 23 Jun 2022 00:51:41 +0200
Subject: [PATCH 3/4] double "view more" button threshold
---
files/routes/posts.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/files/routes/posts.py b/files/routes/posts.py
index 4fc0f06598..fbe542042a 100644
--- a/files/routes/posts.py
+++ b/files/routes/posts.py
@@ -322,7 +322,7 @@ def viewmore(v, pid, sort, offset):
comments2.append(comment)
ids.add(comment.id)
count += g.db.query(Comment).filter_by(parent_submission=post.id, top_comment_id=comment.id).count() + 1
- if count > 50: break
+ if count > 100: break
else:
for comment in comments:
comments2.append(comment)
From 7e6e04b231027702e5d448c754a3aebba6fc2871 Mon Sep 17 00:00:00 2001
From: Aevann1
Date: Thu, 23 Jun 2022 01:13:21 +0200
Subject: [PATCH 4/4] sneed
---
files/templates/comments.html | 4 ++--
files/templates/post_actions.html | 2 +-
files/templates/post_actions_mobile.html | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/files/templates/comments.html b/files/templates/comments.html
index dd028908d1..fd435aed2f 100644
--- a/files/templates/comments.html
+++ b/files/templates/comments.html
@@ -449,7 +449,7 @@
Context
-
+
{% if v %}
@@ -652,7 +652,7 @@
Context
- Copy link
+ Copy link
{% if v %}
Report
diff --git a/files/templates/post_actions.html b/files/templates/post_actions.html
index b3325d4bde..e9d5cc72de 100644
--- a/files/templates/post_actions.html
+++ b/files/templates/post_actions.html
@@ -12,7 +12,7 @@
Give Award
{% endif %}
-Copy link
+Copy link
{% if v %}
Subscribe
diff --git a/files/templates/post_actions_mobile.html b/files/templates/post_actions_mobile.html
index 9d7a267b21..d4f291fd07 100644
--- a/files/templates/post_actions_mobile.html
+++ b/files/templates/post_actions_mobile.html
@@ -8,7 +8,7 @@
{% if not p.ghost or v.id == AEVANN_ID %}{% endif %}
-
+