diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon-notifications.el | 21 | ||||
-rw-r--r-- | lisp/mastodon-tl.el | 4 |
2 files changed, 10 insertions, 15 deletions
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index eed3d20..238feac 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -101,8 +101,8 @@ map) "Keymap for viewing notifications.") -(defun mastodon-notifications--byline-concat (message) - "Add byline for TOOT with MESSAGE." +(defun mastodon-notifications--byline-action-str (message) + "Return an action (top) byline string for TOOT with MESSAGE." (concat " " (propertize message 'face 'mastodon-boosted-face) " " (cdr (assoc message mastodon-notifications--response-alist)) @@ -289,11 +289,13 @@ ACCOUNTS is data of the accounts that have reacted to the notification." (defun mastodon-notifications--action-byline (type &optional accounts group note follower-name) - "TYPE ACCOUNTS GROUP NOTE FOLLOWER-NAME." + "Return an action (top) byline for notification of TYPE. +ACCOUNTS and GROUP group are used by grouped notifications. +NOTE and FOLLOWER-NAME are used for non-grouped notifs." (let ((action-str (unless (member type '(follow follow_request mention)) (downcase - (mastodon-notifications--byline-concat + (mastodon-notifications--byline-action-str (alist-get type mastodon-notifications--action-alist))))) (action-symbol (if (eq type 'mention) "" @@ -354,15 +356,8 @@ AUTHOR-BYLINE is an optional function for adding the author portion of the byline that takes one variable. By default it is `mastodon-tl--byline-author'. ACTION-BYLINE is a string, obtained by calling -`mastodon-notifications--byline-concat'. -ACTION-AUTHORS is a string of those who have responded to the -current item, obtained by calling -`mastodon-notifications--byline-accounts'. -ACTION-SYMBOL is a symbol indicating a favourite, boost, or edit. -ID is that of the status if it is a notification, which is -attached as a `item-id' property if provided. If the -status is a favourite or boost notification, BASE-TOOT is the -JSON of the toot responded to. +`mastodon-notifications--action-byline'. +BASE-TOOT is the 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. diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index f321e41..3e1d49f 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -640,7 +640,8 @@ is extracted from it." "Format a byline handle from account in TOOT. DOMAIN is optionally added to the handle. ACCOUNT is optionally acccount data to use. -STRING is optionally the string to propertize. +STRING is optionally the string to propertize, it is used to make +username rather than handle buttons. FACE is optionally the face to use. The last two args allow for display a username as a clickable handle." @@ -676,7 +677,6 @@ ACCOUNT is optionally acccount data to use." (defun mastodon-tl--byline-author (toot &optional avatar domain base) "Propertize author of TOOT. -If TOOT contains a reblog, return author of reblogged item. With arg AVATAR, include the account's avatar image. When DOMAIN, force inclusion of user's domain in their handle. BASE means to use data from the base item (reblog slot) if possible. |