aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-10-17 19:28:08 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-10-17 19:28:08 +0200
commitc784cb81ab693d0979425b1cd223df106f9802fc (patch)
tree2751cead714c726dc89899032313613e3d19c6e2 /lisp/mastodon-tl.el
parent532f608fe52f1dd326df4995dcef69fb5c431c1e (diff)
notifs: fix pagination using grouped min/max ids
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el20
1 files changed, 16 insertions, 4 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 6005a54..99663ac 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -2216,16 +2216,28 @@ BACKWARD means move backward (up) the timeline."
(get-text-property (point) prop)))))
(defun mastodon-tl--newest-id ()
- "Return item-id from the top of the buffer."
+ "Return item-id from the top of the buffer.
+If we are in a notifications view, return `notifications-max-id'."
(save-excursion
(goto-char (point-min))
- (mastodon-tl--property 'item-id)))
+ (mastodon-tl--property
+ (if (eq (mastodon-tl--get-buffer-type)
+ (member (mastodon-tl--get-buffer-type)
+ '(mentions notifications)))
+ 'notifications-max-id
+ 'item-id))))
(defun mastodon-tl--oldest-id ()
- "Return item-id from the bottom of the buffer."
+ "Return item-id from the bottom of the buffer.
+If we are in a notifications view, return `notifications-min-id'."
(save-excursion
(goto-char (point-max))
- (mastodon-tl--property 'item-id nil :backward)))
+ (mastodon-tl--property
+ (if (member (mastodon-tl--get-buffer-type)
+ '(mentions notifications))
+ 'notifications-min-id
+ 'item-id)
+ nil :backward)))
(defun mastodon-tl--as-string (numeric)
"Convert NUMERIC to string."