aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-06-02 17:31:24 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-06-02 17:31:24 +0200
commitde2937d9fa1a35cbc05e1c3d0dd6856d393b4111 (patch)
tree5035fc8d11fd878214c369d4d96bebe1ad0b170a
parent3303e85db950578d667bc686af7f866a60ba0ec1 (diff)
poll not toot arg for format-poll
-rw-r--r--lisp/mastodon-tl.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index dc1f251..89d70a5 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1232,9 +1232,9 @@ LONGEST-OPTION is the option whose length determines the formatting."
(format "[%s votes]" (or (alist-get 'votes_count option)
"0"))))
-(defun mastodon-tl--format-poll (toot)
+(defun mastodon-tl--format-poll (poll)
"If TOOT includes a poll, return it as a formatted string."
- (let-alist (mastodon-tl--field 'poll toot) ; toot or reblog
+ (let-alist poll
(let* ((option-titles (mastodon-tl--map-alist 'title .options))
(longest-option (car (sort option-titles
(lambda (x y)
@@ -1454,7 +1454,8 @@ Runs `mastodon-tl--render-text' and fetches poll or media."
(media-p (mastodon-tl--field 'media_attachments toot)))
(concat (mastodon-tl--render-text content toot)
(when poll-p
- (mastodon-tl--format-poll toot))
+ (mastodon-tl--format-poll
+ (mastodon-tl--field 'poll toot))) ;; toot or reblog
(when media-p
(mastodon-tl--media toot)))))