diff options
author | marty hiatt <martianhiatus@disroot.org> | 2024-10-25 20:21:19 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus@disroot.org> | 2024-10-25 20:22:56 +0200 |
commit | f154ff9ce0e4bb883dbf2925f86a7ba461b861b7 (patch) | |
tree | 28e361dcab7fbdac49f4235ba70163df5bfc4898 | |
parent | a448d11e19659aca14a6d98274b58683248a7a6b (diff) |
v rough severance/mod warning notifs. WIP. #593 #594
can complete these when we see some in the wild.
-rw-r--r-- | lisp/mastodon-notifications.el | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 747ab8b..db78ef7 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -92,7 +92,8 @@ make them unweildy." (defvar mastodon-notifications--types '("favourite" "reblog" "mention" "poll" - "follow_request" "follow" "status" "update") + "follow_request" "follow" "status" "update" + "severed_relationships" "moderation_warning") "A list of notification types according to their name on the server.") (defvar mastodon-notifications--response-alist @@ -210,6 +211,25 @@ JSON is a list of alists." for x in ids collect (mastodon-notifications--alist-by-value x 'id json))) +(defun mastodon-notifications--severance-body (group) + "Return a body for a severance notification GROUP." + ;; FIXME: actually implement this when we encounter one in the wild! + (let-alist (alist-get 'event group) + (concat .description ": " + .target_name + "\nRelationships affected: " + .relationships_count))) + +(defun mastodon-notifications--mod-warning-body (group) + "Return a body for a moderation warning notification GROUP." + (let-alist (alist-get ) + (concat .description ": " + .text + "\nStatuses: " + .status_ids + "\nfor account: " + .target_account))) + (defun mastodon-notifications--format-note (group status accounts) "Format for a GROUP notification. STATUS is the status's JSON. @@ -258,6 +278,10 @@ ACCOUNTS is data of the accounts that have reacted to the notification." (concat ":\n" (mastodon-notifications--comment-note-text body))))) + ((eq type-sym 'severed_relationships) + (mastodon-notifications--severance-body group)) + ((eq type-sym 'moderation_warning) + (mastodon-notifications--mod-warning-body group)) ((member type-sym '(favourite reblog)) (propertize (mastodon-notifications--comment-note-text body))) |