aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-05-31 14:11:49 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-05-31 14:11:49 +0200
commit2b426fb913b248d161122de9cca5368c60f72cea (patch)
tree2a1d023d6e328238c9088da9bfb107ec8446aff3 /lisp/mastodon-tl.el
parentddcaf0e1b2db6097d5e942eb75ffb27b86c6b1cb (diff)
working max-id arg for hometimeline/reload
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el19
1 files changed, 12 insertions, 7 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 14603b8..070c153 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -460,14 +460,18 @@ With a double PREFIX arg, only show posts with media."
params
(when (eq prefix 4) t))))
-(defun mastodon-tl--get-home-timeline (&optional arg)
+(defun mastodon-tl--get-home-timeline (&optional arg max-id)
"Open home timeline.
With a single prefix ARG, hide replies."
(interactive "p")
- (message "Loading home timeline...")
- (mastodon-tl--init "home" "timelines/home" 'mastodon-tl--timeline nil
- `(("limit" . ,mastodon-tl--timeline-posts-count))
- (when (eq arg 4) t)))
+ (let* ((params
+ `(("limit" . ,mastodon-tl--timeline-posts-count)
+ ,(when max-id
+ `("max_id" . ,(mastodon-tl--buffer-property 'max-id))))))
+ (message "Loading home timeline...")
+ (mastodon-tl--init "home" "timelines/home" 'mastodon-tl--timeline nil
+ params ;`(("limit" . ,mastodon-tl--timeline-posts-count))
+ (when (eq arg 4) t))))
(defun mastodon-tl--get-remote-local-timeline ()
"Prompt for an instance domain and try to display its local timeline.
@@ -2544,10 +2548,11 @@ the current view."
(defun mastodon-tl--reload-timeline-or-profile (&optional pos)
"Reload the current timeline or profile page.
For use after e.g. deleting a toot.
-POS is a number, where point will be placed."
+POS is a number, where point will be placed.
+Aims to respect any pagination in effect."
(let ((type (mastodon-tl--get-buffer-type)))
(cond ((eq type 'home)
- (mastodon-tl--get-home-timeline))
+ (mastodon-tl--get-home-timeline nil :max-id))
((eq type 'federated)
(mastodon-tl--get-federated-timeline))
((eq type 'local)