From 35313fad4331ddd441370ff0401fe779269a7034 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 14 Oct 2023 09:57:21 +0200 Subject: don't run update in trending/search buffers for now --- lisp/mastodon-tl.el | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'lisp') 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 -- cgit v1.2.3