aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-03-18 21:32:26 +0100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-03-19 13:21:37 +0100
commit135443c63d26d0b77be5370e693aff8643d5078b (patch)
treee0e255b424e58c1cd56659f466fd3bad91f21c2f /lisp/mastodon-tl.el
parent58bab7b01496f2d26dd3d766ff060152daef25e7 (diff)
factor out -tl--map-get-accts
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 61c612a..6e80db3 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1504,6 +1504,13 @@ timeline."
;;; UTILITIES
+;; consider having this return an id / acct alist
+(defun mastodon-tl--map-get-accts (alist)
+ "Return a list of handles from ALIST."
+ (mapcar (lambda (x)
+ (alist-get 'acct x))
+ alist))
+
(defun mastodon-tl--symbol (name)
"Return the unicode symbol (as a string) corresponding to NAME.
If symbol is not displayable, an ASCII equivalent is returned. If
@@ -1872,9 +1879,7 @@ Action must be either \"unblock\" or \"unmute\"."
"mutes")))
(url (mastodon-http--api endpoint))
(json (mastodon-http--get-json url))
- (accts (mapcar (lambda (user)
- (alist-get 'acct user))
- json)))
+ (accts (mastodon-tl--map-get-accts json)))
(when accts
(completing-read (format "Handle of user to %s: " action)
accts