[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mastodon e400757d24 03/18: view notifs by type, w completi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mastodon e400757d24 03/18: view notifs by type, w completing-read. #628. |
Date: |
Mon, 2 Dec 2024 16:00:33 -0500 (EST) |
branch: elpa/mastodon
commit e400757d245f516d356b3d875f0b120c232d2c65
Author: marty hiatt <martianhiatus@disroot.org>
Commit: marty hiatt <martianhiatus@disroot.org>
view notifs by type, w completing-read. #628.
---
lisp/mastodon-notifications.el | 69 ++++++++++++++++++++++++++++++++----------
1 file changed, 53 insertions(+), 16 deletions(-)
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el
index 1fafa3bf69..804cc7d2a1 100644
--- a/lisp/mastodon-notifications.el
+++ b/lisp/mastodon-notifications.el
@@ -81,15 +81,28 @@
"severed_relationships" "moderation_warning")
"A list of notification types according to their name on the server.")
+(defvar mastodon-notifications--filter-types-alist
+ '(("all" . mastodon-notifications--get)
+ ("favourite" . mastodon-notifications--get-favourites)
+ ("reblog" . mastodon-notifications--get-boosts)
+ ("mention" . mastodon-notifications--get-mentions)
+ ("poll" . mastodon-notifications--get-polls)
+ ("follow_request" . mastodon-notifications--get-follow-requests)
+ ("follow" . mastodon-notifications--get-follows)
+ ("status" . mastodon-notifications--get-statuses)
+ ("update" . mastodon-notifications--get-edits))
+ "An alist of notification types and their corresponding load functions.
+Notification types are named according to their name on the server.")
+
(defvar mastodon-notifications--response-alist
- '(("Followed" . "you")
- ("Favourited" . "your post")
- ("Boosted" . "your post")
- ("Mentioned" . "you")
- ("Posted a poll" . "that has now ended")
- ("Requested to follow" . "you")
- ("Posted" . "a post")
- ("Edited" . "their post"))
+ '(("Followed" . "you")
+ ("Favourited" . "your post")
+ ("Boosted" . "your post")
+ ("Mentioned" . "you")
+ ("Posted a poll" . "that has now ended")
+ ("Requested to follow" . "you")
+ ("Posted" . "a post")
+ ("Edited" . "their post"))
"Alist of subjects for notification types.")
(defvar mastodon-notifications--map
@@ -171,14 +184,14 @@ Can be called in notifications view or in follow-requests
view."
"List of notification types for which grouping is implemented.")
(defvar mastodon-notifications--action-alist
- '((reblog . "Boosted")
- (favourite . "Favourited")
- (follow_request . "Requested to follow")
- (follow . "Followed")
- (mention . "Mentioned")
- (status . "Posted")
- (poll . "Posted a poll")
- (update . "Edited"))
+ '((reblog . "Boosted")
+ (favourite . "Favourited")
+ (follow_request . "Requested to follow")
+ (follow . "Followed")
+ (mention . "Mentioned")
+ (status . "Posted")
+ (poll . "Posted a poll")
+ (update . "Edited"))
"Action strings keyed by notification type.
Types are those of the Mastodon API.")
@@ -478,6 +491,15 @@ NO-GROUP means don't render grouped notifications."
(mastodon-notifications--render json (not mastodon-group-notifications))
(goto-char (point-min))))
+(defun mastodon-notifications--get-type ()
+ "Read a notification type and load its timeline."
+ (interactive)
+ (let ((choice (completing-read "View notifications: "
+ mastodon-notifications--filter-types-alist)))
+ (funcall (alist-get
+ choice mastodon-notifications--filter-types-alist
+ nil nil #'equal))))
+
(defun mastodon-notifications--get-mentions ()
"Display mention notifications in buffer."
(interactive)
@@ -505,6 +527,21 @@ Status notifications are created when you call
(interactive)
(mastodon-notifications-get "status" "statuses"))
+(defun mastodon-notifications--get-follows ()
+ "Display follow notifications in buffer."
+ (interactive)
+ (mastodon-notifications-get "follow" "follows"))
+
+(defun mastodon-notifications--get-follow-requests ()
+ "Display follow request notifications in buffer."
+ (interactive)
+ (mastodon-notifications-get "follow_request" "follow-requests"))
+
+(defun mastodon-notifications--get-edits ()
+ "Display edited post notifications in buffer."
+ (interactive)
+ (mastodon-notifications-get "update" "edits"))
+
(defun mastodon-notifications--filter-types-list (type)
"Return a list of notification types with TYPE removed."
(remove type mastodon-notifications--types))
- [nongnu] elpa/mastodon 1545f3b78e 05/18: get-toot-author: never get booster profile. #630., (continued)
- [nongnu] elpa/mastodon 1545f3b78e 05/18: get-toot-author: never get booster profile. #630., ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon e9f77777dd 11/18: add cycle notif function. FIX #628., ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon 10be1f9c28 18/18: Merge branch 'develop', ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon 95d06a03eb 15/18: flycheck notifs.el, ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon 241d26dc1f 10/18: notif types: use types[] not exclude_types[], ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon be4a64a4ff 13/18: index, ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon ba7e98c29c 17/18: bump, ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon 08307fee1b 14/18: notifs: require mastodon-widget, ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon c08a84f82b 16/18: notifs cycle: buff type mentions or notifs, ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon 00b1ac63d5 04/18: notifications--render: fallback to first id if no status_id. ??, ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon e400757d24 03/18: view notifs by type, w completing-read. #628.,
ELPA Syncer <=
- [nongnu] elpa/mastodon 213b5b4f5f 07/18: get-toot-author: use do-if-item, not with-toot-item., ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon 2bfd9f097d 08/18: align mastodon keymap, ELPA Syncer, 2024/12/02