aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/mastodon-tl.el42
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