diff options
author | marty hiatt <martianhiatus@riseup.net> | 2024-05-22 20:29:41 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus@riseup.net> | 2024-05-22 20:29:41 +0200 |
commit | b08f59573b615045cd6d73966eaeb2779fc70cd2 (patch) | |
tree | 16833a2cbb53d046e4c57043b6e54e7201f19d38 /lisp | |
parent | f04121e1f8273fccdfc76d9106d0d132d5c701d1 (diff) |
add commented profile note to foll-req notifs. FIX #519.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon-notifications.el | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 0e367c9..c52c96a 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -186,9 +186,13 @@ Status notifications are given when (defun mastodon-notifications--format-note (note type) "Format for a NOTE of TYPE." - (let ((id (alist-get 'id note)) - (status (mastodon-tl--field 'status note)) - (follower (alist-get 'username (alist-get 'account note)))) + (let* ((id (alist-get 'id note)) + (profile-note (when (equal 'follow-request type) + (mastodon-tl--field + 'note + (mastodon-tl--field 'account note)))) + (status (mastodon-tl--field 'status note)) + (follower (alist-get 'username (alist-get 'account note)))) (mastodon-notifications--insert-status ;; toot (cond ((or (equal type 'follow) @@ -207,14 +211,22 @@ Status notifications are given when (let ((body (mastodon-tl--clean-tabs-and-nl (if (mastodon-tl--has-spoiler status) (mastodon-tl--spoiler status) - (mastodon-tl--content status))))) + (if (equal 'follow-request type) + (mastodon-tl--render-text profile-note) + (mastodon-tl--content status)))))) (cond ((or (eq type 'follow) (eq type 'follow-request)) - (propertize (if (equal type 'follow) - "Congratulations, you have a new follower!" - (format "You have a follow request from... %s" - follower)) - 'face 'default)) + (propertize + (if (equal type 'follow) + (propertize + "Congratulations, you have a new follower!" + 'face 'default) + (concat + (propertize + (format "You have a follow request from... %s:\n" + follower) + 'face 'default) + (mastodon-notifications--comment-note-text body))))) ((or (eq type 'favourite) (eq type 'boost)) (mastodon-notifications--comment-note-text |