From de2937d9fa1a35cbc05e1c3d0dd6856d393b4111 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sun, 2 Jun 2024 17:31:24 +0200 Subject: poll not toot arg for format-poll --- lisp/mastodon-tl.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lisp/mastodon-tl.el') 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))))) -- cgit v1.2.3