diff options
author | marty hiatt <martianhiatus@riseup.net> | 2024-10-12 18:05:29 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus@riseup.net> | 2024-10-12 18:05:29 +0200 |
commit | 56e555945b06662bad0d687c1bc53fabe4beafed (patch) | |
tree | 7ccb518d0f40f29c8c0e1c52506600c198907efe | |
parent | 64a0a0a276b5cadc8b4d98ee28ef1c23b4a799b7 (diff) |
WIP: hacking for grouped notifs to work w new byline code.
-rw-r--r-- | lisp/mastodon-notifications.el | 13 | ||||
-rw-r--r-- | lisp/mastodon-tl.el | 13 |
2 files changed, 21 insertions, 5 deletions
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 7632173..b758c6f 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -231,6 +231,7 @@ JSON is the full notifications JSON." (if (member type-sym '(follow follow_request)) ;; Using reblog with an empty id will mark this as something ;; non-boostable/non-favable. + ;; status (cons '(reblog (id . nil)) status) ;;note)) ;; reblogs/faves use 'note' to process their own json not the ;; toot's. this ensures following etc. work on such notifs @@ -261,10 +262,16 @@ JSON is the full notifications JSON." (mastodon-notifications--comment-note-text body)) (t body))) ;; author-byline - (lambda (&rest _args) - (mastodon-notifications--byline-account accounts status)) + (cond ((member type-sym '(favourite reblog mention)) + (lambda (&rest _args) + (mastodon-notifications--byline-accounts accounts status group))) + ((eq type-sym 'follow_request) + (lambda (&rest _args) + (mastodon-tl--byline-uname-+-handle status nil (car accounts)))) + (t #'mastodon-tl--byline-author)) + ;; #'mastodon-tl--byline-author ;; action-byline - (lambda (_status) + (lambda (&rest _args) (mastodon-notifications--byline-concat (alist-get type-sym mastodon-notifications--action-alist))) .status_id diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index ca5ec6f..cf7f9aa 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -589,6 +589,11 @@ Do so if type of status at poins is not follow_request/follow." (string= type "follow")) ; no counts for these (message "%s" echo))))) +;; FIXME: now that this can also be used for non byline rendering, let's remove +;; the toot arg, and deal with attachments higher up (on real author +;; byline only) +;; removing toot arg makes it easier to render notifs that have no status +;; (foll_reqs) (defun mastodon-tl--byline-username (toot &optional account) "Format a byline username from account in TOOT." (let-alist (or account (alist-get 'account toot)) @@ -627,6 +632,11 @@ DOMAIN is optionally added to the handle." 'mastodon-handle (concat "@" .acct) 'help-echo (concat "Browse user profile of @" .acct)))) +(defun mastodon-tl--byline-uname-+-handle (data &optional domain account) + "" + (concat (mastodon-tl--byline-username data account) + " (" (mastodon-tl--byline-handle data domain account) ")")) + (defun mastodon-tl--byline-author (toot &optional avatar domain base) "Propertize author of TOOT. If TOOT contains a reblog, return author of reblogged item. @@ -649,8 +659,7 @@ If BASE is nil, we are a boosted byline, so show less info." (alist-get 'account data)))) (if (not base) (mastodon-tl--byline-handle data domain) - (concat (mastodon-tl--byline-username data) - " (" (mastodon-tl--byline-handle data domain) ")"))))) + (mastodon-tl--byline-uname-+-handle data domain))))) (defun mastodon-tl--format-byline-help-echo (toot) "Format a help-echo for byline of TOOT. |