[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mastodon 089eee6485 15/50: notifs: fix author action bylin
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mastodon 089eee6485 15/50: notifs: fix author action byline, top, for ungrouped. FIX #612 |
Date: |
Sat, 2 Nov 2024 13:00:52 -0400 (EDT) |
branch: elpa/mastodon
commit 089eee64854ad6d8a880b0949fba7e2c1fb04cc6
Author: marty hiatt <martianhiatus@disroot.org>
Commit: marty hiatt <martianhiatus@disroot.org>
notifs: fix author action byline, top, for ungrouped. FIX #612
---
lisp/mastodon-notifications.el | 28 ++++++++++++----------------
lisp/mastodon-tl.el | 37 +++++++++++++++++++------------------
2 files changed, 31 insertions(+), 34 deletions(-)
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el
index d9f7114a52..862f2a2298 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"
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 3a7988e76b..6f510b30af 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -615,24 +615,25 @@ Do so if type of status at poins is not
follow_request/follow."
"Format a byline username from account in TOOT.
TOOT may be account data, or toot data, in which case acount data
is extracted from it."
- (let-alist (or (alist-get 'account toot)
- toot) ;; grouped nofifs use account data directly
- (propertize (if (not (string-empty-p .display_name))
- .display_name
- .username)
- 'face 'mastodon-display-name-face
- ;; enable playing of videos when point is on byline:
- ;; 'attachments (mastodon-tl--get-attachments-for-byline toot)
- 'keymap mastodon-tl--byline-link-keymap
- ;; echo faves count when point on post author name:
- ;; which is where --goto-next-toot puts point.
- 'help-echo
- ;; but don't add it to "following"/"follows" on
- ;; profile views: we don't have a tl--buffer-spec
- ;; yet:
- (unless (or (string-suffix-p "-followers*" (buffer-name))
- (string-suffix-p "-following*" (buffer-name)))
- (mastodon-tl--format-byline-help-echo toot)))))
+ (let ((data (or (alist-get 'account toot)
+ toot))) ;; grouped nofifs use account data directly
+ (let-alist data
+ (propertize (if (not (string-empty-p .display_name))
+ .display_name
+ .username)
+ 'face 'mastodon-display-name-face
+ ;; enable playing of videos when point is on byline:
+ ;; 'attachments (mastodon-tl--get-attachments-for-byline
toot)
+ 'keymap mastodon-tl--byline-link-keymap
+ ;; echo faves count when point on post author name:
+ ;; which is where --goto-next-toot puts point.
+ 'help-echo
+ ;; but don't add it to "following"/"follows" on
+ ;; profile views: we don't have a tl--buffer-spec
+ ;; yet:
+ (unless (or (string-suffix-p "-followers*" (buffer-name))
+ (string-suffix-p "-following*" (buffer-name)))
+ (mastodon-tl--format-byline-help-echo data))))))
(defun mastodon-tl--byline-handle (toot &optional domain string face)
"Format a byline handle from account in TOOT.
- [nongnu] elpa/mastodon 0e75fc74ee 01/50: group-notifs custom (for servers without). #608. WIP., (continued)
- [nongnu] elpa/mastodon 0e75fc74ee 01/50: group-notifs custom (for servers without). #608. WIP., ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon bfb17cdf91 10/50: docstrings tl.el, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon f3602493da 03/50: fix notifs custom group, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 8446f239bb 02/50: working v1 notifications custom. #608, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon b529690f96 06/50: notifs: refactor some v1/v2 calling code, mastodon-notifiations--body-arg, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 14e3fa36cb 11/50: start on pagination for v1 notifs. #610, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 4505b4e818 05/50: index, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 1ba949586e 29/50: tl: improve ctrl flow in --spoiler + --toot. FIX #579, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 5cb2bf1c04 16/50: FIX #610 fix note/base toot in format-note/author byline., ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon b6676c180b 27/50: tl: improve ctrl flow in --spoiler + --toot, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 089eee6485 15/50: notifs: fix author action byline, top, for ungrouped. FIX #612,
ELPA Syncer <=
- [nongnu] elpa/mastodon d06ac674ef 19/50: docs: remove old arg docstring, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon b05de5f907 30/50: some ifs become whens, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon add6bfceaf 34/50: remove elsa from Cask, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 31557be472 50/50: Merge branch 'develop', ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon c4edecd145 23/50: cask build cleanups, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 2713081605 18/50: notifs: byline-accounts: remove toot arg, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 3ec8a8386b 35/50: Merge branch 'non-group-notifs' into develop, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 2bb6ad95f7 25/50: toot.el cask build cleanups, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 2c3f35c953 31/50: some ifs become whens, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon f1bdef0b73 40/50: revert transient polls to use mastodon-toot-poll, ELPA Syncer, 2024/11/02