[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mastodon 380c6be86f 22/50: keep cleaning up notifs insert
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mastodon 380c6be86f 22/50: keep cleaning up notifs insert note |
Date: |
Sat, 2 Nov 2024 13:00:53 -0400 (EDT) |
branch: elpa/mastodon
commit 380c6be86f570854cc9b2a714f36301339e57c8b
Author: marty hiatt <martianhiatus@disroot.org>
Commit: marty hiatt <martianhiatus@disroot.org>
keep cleaning up notifs insert note
---
lisp/mastodon-notifications.el | 99 +++++++++++++++++++++---------------------
1 file changed, 49 insertions(+), 50 deletions(-)
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el
index e5ad1ea812..99d9d89d44 100644
--- a/lisp/mastodon-notifications.el
+++ b/lisp/mastodon-notifications.el
@@ -348,7 +348,7 @@ FILTERS STATUS PROFILE-NOTE FOLLOWER-NAME GROUP."
(defun mastodon-notifications--insert-note
(toot body action-byline
&optional base-toot unfolded group accounts type)
-"Display the content and byline of timeline element TOOT.
+ "Display the content and byline of timeline element TOOT.
BODY will form the section of the toot above the byline.
AUTHOR-BYLINE is an optional function for adding the author
portion of the byline that takes one variable. By default it is
@@ -368,55 +368,54 @@ foldable.
GROUP is the notification group 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)))
- (toot-foldable
- (and mastodon-tl--fold-toots-at-length
- (length> body mastodon-tl--fold-toots-at-length)))
- (follower (alist-get 'account toot))
- (follower-name (or (alist-get 'display_name follower)
- (alist-get 'username follower))))
- (insert
- (propertize ;; top byline, body + byline:
- (concat
- (if (equal type "mention") ;; top (action) byline
- ""
- action-byline)
- ;; (mastodon-notifications--action-byline
- ;; (intern type) accounts group toot follower-name))
- (propertize body ;; body only
- 'toot-body t) ;; includes newlines etc. for folding
- "\n"
- ;; actual byline:
- (mastodon-tl--byline
- toot nil nil base-toot group
- ;; 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))))
- 'item-type 'toot ;; for nav, actions, etc.
- 'item-id (or (alist-get 'page_max_id group) ;; newest notif
- (alist-get 'id toot)) ; toot id
- 'base-item-id (mastodon-tl--item-id
- ;; if status is a notif, get id from base-toot
- ;; (-tl--item-id toot) will not work here:
- (or base-toot
- toot)) ; else normal toot with reblog check
- 'item-json toot
- 'base-toot base-toot
- 'cursor-face 'mastodon-cursor-highlight-face
- 'toot-foldable toot-foldable
- 'toot-folded (and toot-foldable (not unfolded))
- ;; grouped notifs data:
- 'notification-type type
- 'notification-id (alist-get 'group_key group)
- 'notification-group group
- 'notification-accounts accounts
- ;; for pagination:
- 'notifications-min-id (alist-get 'page_min_id group)
- 'notifications-max-id (alist-get 'page_max_id group))
- "\n")))
+ (let* ((type (if type
+ (symbol-name type) ;; non-group
+ (alist-get 'type group)))
+ (toot-foldable
+ (and mastodon-tl--fold-toots-at-length
+ (length> body mastodon-tl--fold-toots-at-length)))
+ (follower (alist-get 'account toot))
+ (follower-name (or (alist-get 'display_name follower)
+ (alist-get 'username follower)))
+ (ts ;; types listed here use base item timestamp, else we use
+ ;; group's latest timestamp:
+ (when (and group
+ (not
+ (member type '("favourite" "reblog" "edit" "poll"))))
+ (mastodon-tl--field 'latest_page_notification_at group))))
+ (insert
+ (propertize ;; top byline, body + byline:
+ (concat
+ (if (equal type "mention") ;; top (action) byline
+ ""
+ action-byline)
+ (propertize body ;; body only
+ 'toot-body t) ;; includes newlines etc. for folding
+ "\n"
+ ;; actual byline:
+ (mastodon-tl--byline toot nil nil base-toot group ts))
+ 'item-type 'toot ;; for nav, actions, etc.
+ 'item-id (or (alist-get 'page_max_id group) ;; newest notif
+ (alist-get 'id toot)) ; toot id
+ 'base-item-id (mastodon-tl--item-id
+ ;; if status is a notif, get id from base-toot
+ ;; (-tl--item-id toot) will not work here:
+ (or base-toot
+ toot)) ; else normal toot with reblog check
+ 'item-json toot
+ 'base-toot base-toot
+ 'cursor-face 'mastodon-cursor-highlight-face
+ 'toot-foldable toot-foldable
+ 'toot-folded (and toot-foldable (not unfolded))
+ ;; grouped notifs data:
+ 'notification-type type
+ 'notification-id (alist-get 'group_key group)
+ 'notification-group group
+ 'notification-accounts accounts
+ ;; for pagination:
+ 'notifications-min-id (alist-get 'page_min_id group)
+ 'notifications-max-id (alist-get 'page_max_id group))
+ "\n")))
(defun mastodon-notifications--byline-accounts
(accounts group &optional avatar)
- [nongnu] elpa/mastodon updated (c241b0ba9d -> 31557be472), ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 7d61f38a6b 07/50: FIX #609. insert-status remove author-byline arg, its always the same function, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 198c7ae8c7 24/50: bump tp version, bump version, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 16779f5820 39/50: readme for some of the new stuff, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 6f9cb5c18f 36/50: add mention symbol, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 464d2e4634 20/50: notifs: factor an action-byline fun (maybe move into insert-note), ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 89f93a1316 08/50: remove ACCOUNT and TYPE from our byline functions., ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon db0e6bdf54 12/50: Merge branch 'develop' into non-group-notifs, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 2b281fcc49 13/50: byte-compile, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 411e9f22e0 14/50: grouped notifs: top byline create with account data, not toot. #612 half fixed., ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 380c6be86f 22/50: keep cleaning up notifs insert note,
ELPA Syncer <=
- [nongnu] elpa/mastodon c7a3ed75ab 26/50: fold-toot - respect CW state, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 8a8b13dc0a 21/50: --byline: pull fave/boost/edit/visibility from base toot if present, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 1bf73f2528 33/50: remove elsa from Cask, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon ee25cb9b02 41/50: update point after widget. FIX #615, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon c09935b100 37/50: tl: remove stale args to insert status, inc. action-byline arg, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon b47390993b 46/50: Merge branch 'poll-var' into develop, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 94ea642a1a 38/50: notifs: improve byline docstrings for new byline logic, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 071c33eed2 32/50: Merge branch 'develop' into non-group-notifs, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon babb3a1adf 28/50: fold-toot - respect CW state, ELPA Syncer, 2024/11/02
- [nongnu] elpa/mastodon 1606b34c5d 45/50: Merge branch 'read-less' into develop, ELPA Syncer, 2024/11/02