emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/mastodon 35313fad43 1/5: don't run update in trending/sear


From: ELPA Syncer
Subject: [nongnu] elpa/mastodon 35313fad43 1/5: don't run update in trending/search buffers for now
Date: Sat, 14 Oct 2023 07:01:12 -0400 (EDT)

branch: elpa/mastodon
commit 35313fad4331ddd441370ff0401fe779269a7034
Author: marty hiatt <martianhiatus [a t] riseup [d o t] net>
Commit: marty hiatt <martianhiatus [a t] riseup [d o t] net>

    don't run update in trending/search buffers for now
---
 lisp/mastodon-tl.el | 42 +++++++++++++++++++++++-------------------
 1 file changed, 23 insertions(+), 19 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index a45b2fec60..68147d9b46 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]