From 907991314d0f4e2b88eeb093a6222468e77c9068 Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 15 Feb 2022 15:06:39 +0100 Subject: improve use of goto-next-toot on timeline loading --- lisp/mastodon-tl.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 32bb73e..efccc21 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1459,7 +1459,6 @@ JSON is the data returned from the server." mastodon-tl--timestamp-next-update (time-add (current-time) (seconds-to-time 300))) (funcall update-function json)) - (mastodon-tl--goto-next-toot) (mastodon-mode) (when (equal endpoint "follow_requests") (mastodon-profile-mode) @@ -1477,7 +1476,11 @@ JSON is the data returned from the server." nil ;; don't repeat #'mastodon-tl--update-timestamps-callback (current-buffer) - nil))))) + nil))) + (when (or (equal endpoint "notifications") + (string-prefix-p "timelines" endpoint) + (string-prefix-p "statuses" endpoint)) + (mastodon-tl--goto-next-toot)))) (defun mastodon-tl--init-sync (buffer-name endpoint update-function) "Initialize BUFFER-NAME with timeline targeted by ENDPOINT. @@ -1509,7 +1512,11 @@ Runs synchronously." nil ;; don't repeat #'mastodon-tl--update-timestamps-callback (current-buffer) - nil)))) + nil))) + (when (or (equal endpoint "notifications") + (string-prefix-p "timelines" endpoint) + (string-prefix-p "statuses" endpoint)) + (mastodon-tl--goto-next-toot))) buffer)) (provide 'mastodon-tl) -- cgit v1.2.3