diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-10-14 09:57:21 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-10-14 09:57:21 +0200 |
commit | 35313fad4331ddd441370ff0401fe779269a7034 (patch) | |
tree | 2a170a408a0421f1db801d1870ff8fc5b35b1564 | |
parent | 2cb0a5012af337dd99663d0a3cbbebd332009633 (diff) |
don't run update in trending/search buffers for now
-rw-r--r-- | lisp/mastodon-tl.el | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index a45b2fe..68147d9 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -2583,25 +2583,29 @@ This location is defined by a non-nil value of (defun mastodon-tl--update () "Update timeline with new toots." (interactive) - ;; FIXME: handle update for search and trending buffers - (let* ((endpoint (mastodon-tl--endpoint)) - (update-function (mastodon-tl--update-function))) - ;; update a thread, without calling `mastodon-tl--updated-json': - (if (mastodon-tl--buffer-type-eq 'thread) - (let ((thread-id (mastodon-tl--property 'toot-id))) - (funcall update-function thread-id)) - ;; update other timelines: - (let* ((id (mastodon-tl--newest-id)) - (params (mastodon-tl--update-params)) - (json (mastodon-tl--updated-json endpoint id params))) - (if json - (let ((inhibit-read-only t)) - (mastodon-tl--set-after-update-marker) - (goto-char (or mastodon-tl--update-point (point-min))) - (funcall update-function json) - (when mastodon-tl--after-update-marker - (goto-char mastodon-tl--after-update-marker))) - (message "nothing to update")))))) + (if (or (mastodon-tl--buffer-type-eq 'trending-statuses) + (mastodon-tl--buffer-type-eq 'trending-tags) + (mastodon-tl--search-buffer-p)) + (message "update not available in this view.") + ;; FIXME: handle update for search and trending buffers + (let* ((endpoint (mastodon-tl--endpoint)) + (update-function (mastodon-tl--update-function))) + ;; update a thread, without calling `mastodon-tl--updated-json': + (if (mastodon-tl--buffer-type-eq 'thread) + (let ((thread-id (mastodon-tl--property 'toot-id))) + (funcall update-function thread-id)) + ;; update other timelines: + (let* ((id (mastodon-tl--newest-id)) + (params (mastodon-tl--update-params)) + (json (mastodon-tl--updated-json endpoint id params))) + (if json + (let ((inhibit-read-only t)) + (mastodon-tl--set-after-update-marker) + (goto-char (or mastodon-tl--update-point (point-min))) + (funcall update-function json) + (when mastodon-tl--after-update-marker + (goto-char mastodon-tl--after-update-marker))) + (message "nothing to update"))))))) ;;; LOADING TIMELINES |