aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormousebot <mousebot@riseup.net>2022-01-05 14:14:36 +0100
committermousebot <mousebot@riseup.net>2022-01-05 14:14:36 +0100
commitb21ebf6c3fbbeb100e8ed84c5af0e80fee55dfe1 (patch)
treed8ff2001c9fab0daf40f9958808a1b62ed046a5c
parentf6b7e5f3107e1b1d4abfb93f9dad1c2dfffee958 (diff)
add support for poll notifications
finally we now display all types of notifications! it's about bloody time.
-rw-r--r--lisp/mastodon-notifications.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el
index 921fdc7..29412b6 100644
--- a/lisp/mastodon-notifications.el
+++ b/lisp/mastodon-notifications.el
@@ -55,7 +55,8 @@
("favourite" . mastodon-notifications--favourite)
("reblog" . mastodon-notifications--reblog)
("follow_request" . mastodon-notifications--follow-request)
- ("status" . mastodon-notifications--status))
+ ("status" . mastodon-notifications--status)
+ ("poll" . mastodon-notifications--poll))
"Alist of notification types and their corresponding function.")
(defvar mastodon-notifications--response-alist
@@ -64,7 +65,8 @@
("Favourited" . "your status from")
("Boosted" . "your status from")
("Requested to follow" . "you")
- ("Posted" . "a post"))
+ ("Posted" . "a post")
+ ("Posted a poll" . "that has now ended"))
"Alist of subjects for notification types.")
(defun mastodon-notifications--byline-concat (message)
@@ -151,6 +153,10 @@ Status notifications are given when
`mastodon-tl--enable-notify-user-posts' has been set."
(mastodon-notifications--format-note note 'status))
+(defun mastodon-notifications--poll (note)
+ "Format for a `poll' NOTE."
+ (mastodon-notifications--format-note note 'poll))
+
(defun mastodon-notifications--format-note (note type)
"Format for a NOTE of TYPE."
(let ((id (alist-get 'id note))
@@ -194,7 +200,9 @@ Status notifications are given when
((equal type 'mention)
"Mentioned")
((equal type 'status)
- "Posted"))))
+ "Posted")
+ ((equal type 'poll)
+ "Posted a poll"))))
id)))
(defun mastodon-notifications--insert-status (toot body author-byline action-byline id)