diff options
author | marty hiatt <martianhiatus@disroot.org> | 2024-10-30 08:52:46 +0100 |
---|---|---|
committer | marty hiatt <martianhiatus@disroot.org> | 2024-10-30 09:28:14 +0100 |
commit | 89f93a1316b229313dac36125a6ad439ed1e1ae1 (patch) | |
tree | 3d035eeba80b87cfa95ec3ae7e3d2316f88ddf03 /lisp/mastodon-notifications.el | |
parent | 7d61f38a6bbe8a329892c5e91d1627a3ab03ee66 (diff) |
remove ACCOUNT and TYPE from our byline functions.
to avoid them, for foll/reqs we send the full notif as TOOT arg, and fetch
type/account from it as needed. muuuuuuuuch simpler, fingers crossed.
fix grouped notifs new non-account arg byline code
fix handle byline for grouped notifs
Diffstat (limited to 'lisp/mastodon-notifications.el')
-rw-r--r-- | lisp/mastodon-notifications.el | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 6d6b339..1b04699 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -238,7 +238,7 @@ JSON is a list of alists." (mastodon-notifications--insert-note ;; toot (if (member type '(follow follow_request)) - follower + note ;; full notif, not just follower acct? status) ;; body (mastodon-notifiations--body-arg @@ -281,8 +281,7 @@ 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 (alist-get 'account note)))) + (t (mastodon-tl--byline-username note))) ;; action symbol: (unless (eq type 'mention) (mastodon-tl--symbol type)) @@ -395,7 +394,8 @@ JSON of the toot responded to. UNFOLDED is a boolean meaning whether to unfold or fold item if foldable. GROUP is the notification group data. -ACCOUNTS is the notification accounts data." +ACCOUNTS is the notification accounts data. +TYPE is notification type, used for non-group notifs." (let* ((type (if type (symbol-name type) ;; non-group (alist-get 'type group))) @@ -417,16 +417,10 @@ ACCOUNTS is the notification accounts data." ;; actual byline: (mastodon-tl--byline toot nil nil base-toot group - ;; FIXME: remove account arg (esp. if we have type). maybe we need - ;; type arg when we step from notifs (here); to tl--byline land - ;; (there): - (when (member type '("follow" "follow_request")) - toot) ;; account data! ;; types listed here use base item timestamp, else we use group's ;; latest timestamp: (when (not (member type '("favourite" "reblog" "edit" "poll"))) - (mastodon-tl--field 'latest_page_notification_at group)) - type)) + (mastodon-tl--field 'latest_page_notification_at group)))) 'item-type 'toot ;; for nav, actions, etc. 'item-id (or (alist-get 'page_max_id group) ;; newest notif (alist-get 'id toot)) ; toot id @@ -478,7 +472,7 @@ When DOMAIN, force inclusion of user's domain in their handle." (mastodon-tl--image-trans-check)) (mastodon-media--get-avatar-rendering .avatar)) (let ((uname (mastodon-tl--display-or-uname account))) - (mastodon-tl--byline-handle toot nil account + (mastodon-tl--byline-handle toot nil uname 'mastodon-display-name-face)) ", "))) nil ", ") |