From 4eb0b578b5e4ba920999427c137b98043b41c9d4 Mon Sep 17 00:00:00 2001 From: mousebot Date: Wed, 5 Jan 2022 14:14:36 +0100 Subject: add support for poll notifications finally we now display all types of notifications! it's about bloody time. --- lisp/mastodon-notifications.el | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'lisp/mastodon-notifications.el') diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 921fdc7..9444658 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)) @@ -186,7 +192,7 @@ Status notifications are given when (cond ((equal type 'boost) "Boosted") ((equal type 'favorite) - "Favorited") + "Favourited") ((equal type 'follow-request) "Requested to follow") ((equal type 'follow) @@ -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) -- cgit v1.2.3 From c6b613a65bb796f89bf7b46f4dace53f97ce392f Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 11 Jan 2022 21:18:23 +0100 Subject: byte compile warnings --- lisp/mastodon-notifications.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp/mastodon-notifications.el') diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 9444658..1361099 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -48,6 +48,7 @@ (autoload 'mastodon-tl--spoiler "mastodon-tl.el") (autoload 'mastodon-tl--toot-id "mastodon-tl.el") (defvar mastodon-tl--display-media-p) +(defvar mastodon-tl--buffer-spec) (defvar mastodon-notifications--types-alist '(("mention" . mastodon-notifications--mention) @@ -174,8 +175,8 @@ Status notifications are given when (propertize (if (equal type 'follow) "Congratulations, you have a new follower!" (format "You have a follow request from... %s" - follower) - 'face 'default)) + follower)) + 'face 'default) (mastodon-tl--clean-tabs-and-nl (if (mastodon-tl--has-spoiler status) (mastodon-tl--spoiler status) -- cgit v1.2.3