diff options
author | marty hiatt <martianhiatus@disroot.org> | 2024-10-30 20:03:16 +0100 |
---|---|---|
committer | marty hiatt <martianhiatus@disroot.org> | 2024-10-30 20:03:16 +0100 |
commit | 089eee64854ad6d8a880b0949fba7e2c1fb04cc6 (patch) | |
tree | ec702bfb30847d6d8ad5576c865dca2cd6e2a452 /lisp/mastodon-notifications.el | |
parent | 411e9f22e0f770b8a416ea587dc8be0260ca4d91 (diff) |
notifs: fix author action byline, top, for ungrouped. FIX #612
Diffstat (limited to 'lisp/mastodon-notifications.el')
-rw-r--r-- | lisp/mastodon-notifications.el | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index d9f7114..862f2a2 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -56,7 +56,6 @@ (autoload 'mastodon-tl--render-text "mastodon-tl") (autoload 'mastodon-notifications-get "mastodon") (autoload 'mastodon-tl--byline-uname-+-handle "mastodon-tl") -(autoload 'mastodon-tl--byline-username "mastodon-tl") (autoload 'mastodon-tl--byline-handle "mastodon-tl") (autoload 'mastodon-http--get-json "mastodon-http") (autoload 'mastodon-media--get-avatar-rendering "mastodon-media") @@ -243,7 +242,7 @@ JSON is a list of alists." ;; body (mastodon-notifiations--body-arg type filters status profile-note follower-name) - ;; action-byline + ;; action-byline (top) (unless (member type '(follow follow_request mention)) (downcase (mastodon-notifications--byline-concat @@ -251,10 +250,9 @@ JSON is a list of alists." ;; action authors (cond ((member type '(follow follow_request mention)) "") ;; mentions are normal statuses - (t (mastodon-tl--byline-username note))) - ;; action symbol: - (unless (eq type 'mention) - (mastodon-tl--symbol type)) + (t (mastodon-tl--byline-handle note nil + follower-name + 'mastodon-display-name-face))) ;; base toot (when (or (eq type 'favourite) (eq type 'boost)) @@ -300,9 +298,6 @@ ACCOUNTS is data of the accounts that have reacted to the notification." "") ;; mentions are normal statuses (t (mastodon-notifications--byline-accounts accounts status group))) - ;; action symbol: - (unless (eq type 'mention) - (mastodon-tl--symbol type)) ;; base toot (no need for update/poll/?) (when (member type '(favourite reblog)) status) @@ -344,7 +339,7 @@ FILTERS STATUS PROFILE-NOTE FOLLOWER-NAME GROUP." (t body)))) (defun mastodon-notifications--insert-note - (toot body action-byline action-authors action-symbol + (toot body action-byline action-authors &optional base-toot unfolded group accounts type) "Display the content and byline of timeline element TOOT. BODY will form the section of the toot above the byline. @@ -369,18 +364,19 @@ TYPE is notification type, used for non-group notifs." (let* ((type (if type (symbol-name type) ;; non-group (alist-get 'type group))) + (action-symbol (unless (eq type 'mention) + (mastodon-tl--symbol (intern type)))) (toot-foldable (and mastodon-tl--fold-toots-at-length (length> body mastodon-tl--fold-toots-at-length)))) (insert (propertize ;; top byline, body + byline: (concat - (propertize ;; top byline - (if (equal type "mention") - "" - (concat action-symbol " " action-authors - action-byline)) - 'byline-top t) + (if (equal type "mention") + "" + (propertize ;; top byline + (concat action-symbol " " action-authors action-byline) + 'byline-top t)) (propertize body ;; body only 'toot-body t) ;; includes newlines etc. for folding "\n" |