aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-03-29 13:37:48 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-03-29 13:38:06 +0200
commitd599eda11f539236238e018d29757b4253cef334 (patch)
treeaaf73fc64885492aa970bcfe77f0064adb6dcba6 /lisp/mastodon-tl.el
parent14dbf79135f6751fc93eb5e85e0b2eae3bde6568 (diff)
user-handles-get: return immediately if only one candidate
FIX #420.
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index fe86c7e..36539d3 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1921,13 +1921,16 @@ LANGS is the accumulated array param alist if we re-run recursively."
(t
(mastodon-profile--extract-users-handles
(mastodon-profile--toot-json))))))
- (completing-read (if (or (equal action "disable")
- (equal action "enable"))
- (format "%s notifications when user posts: " action)
- (format "Handle of user to %s: " action))
- user-handles
- nil ; predicate
- 'confirm))))
+ ;; return immediately if only 1 handle:
+ (if (eq 1 (length user-handles))
+ (car user-handles)
+ (completing-read (if (or (equal action "disable")
+ (equal action "enable"))
+ (format "%s notifications when user posts: " action)
+ (format "Handle of user to %s: " action))
+ user-handles
+ nil ; predicate
+ 'confirm)))))
(defun mastodon-tl--interactive-blocks-or-mutes-list-get (action)
"Fetch the list of accounts for ACTION from the server.