aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormousebot <mousebot@riseup.net>2021-08-10 00:46:05 +0200
committermousebot <mousebot@riseup.net>2021-08-10 00:46:05 +0200
commit838c75295301e3154c4029792565d661e67e0672 (patch)
treec28309d56ca79c929a8b7345a34523118ce8f5ea
parent27edcd6b2010d4b2e39fe57ce6a5f26ef321d49e (diff)
try to handle reblogged polls
-rw-r--r--README.org2
-rw-r--r--lisp/mastodon-tl.el6
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)))