From 838c75295301e3154c4029792565d661e67e0672 Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 10 Aug 2021 00:46:05 +0200 Subject: try to handle reblogged polls --- README.org | 2 +- lisp/mastodon-tl.el | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 6cf318e..e7960bf 100644 --- a/README.org +++ b/README.org @@ -19,7 +19,7 @@ It adds the following features: | =C= | copy url of toot at point | | =d= | delete your toot at point | | =W=, =M=, =B= | (un)follow, (un)mute, (un)block author of toot at point | -| | display polls (very basic for now) | +| | display polls and vote on polls (very basic for now) | | | images are links to the full image, can be zoomed/rotated/saved (see their keymap) | | Toots: | | | | mention booster in replies by default | diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index bacbebf..cf87c0a 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -708,7 +708,9 @@ it is `mastodon-tl--byline-boosted'" (interactive (list (let* ((toot (mastodon-tl--property 'toot-json)) - (poll (mastodon-tl--field 'poll toot)) + (reblog (cdr (assoc 'reblog toot))) + (poll (or (cdr (assoc 'poll reblog)) + (mastodon-tl--field 'poll toot))) (options (mastodon-tl--field 'options poll)) (options-titles (mapcar (lambda (x) (cdr (assoc 'title x))) @@ -735,6 +737,8 @@ it is `mastodon-tl--byline-boosted'" candidates)))))) (if (null (mastodon-tl--field 'poll (mastodon-tl--property 'toot-json))) (message "No poll here.") + ;; TODO: match option number up to option titles so we can message + ;; the full option description, not just the number (let* ((toot (mastodon-tl--property 'toot-json)) (poll (mastodon-tl--field 'poll toot)) (poll-id (cdr (assoc 'id poll))) -- cgit v1.2.3