diff options
| -rw-r--r-- | lisp/mastodon-notifications.el | 38 | 
1 files changed, 32 insertions, 6 deletions
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 31c5518..9b40861 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -53,6 +53,25 @@  (autoload 'mastodon-tl--update "mastodon-tl")  (autoload 'mastodon-views--view-follow-requests "mastodon-views") +(defgroup mastodon-tl nil +  "Nofications in mastodon.el." +  :prefix "mastodon-notifications-" +  :group 'mastodon) + +(defcustom mastodon-notifications--profile-note-in-foll-reqs t +  "When non-nil, show some of a user's profile note in follow +request notifications." +  :type '(boolean)) + +(defcustom mastodon-notifications--profile-note-in-foll-reqs-max-length nil +  "The maximum character length for display of user profile note in +follow requests. +Profile notes are only displayed if +`mastodon-notifications--profile-note-in-foll-reqs' is non-nil. +If unset, profile notes of any size will be displayed, which may +make them unweildy." +  :type '(integer)) +  (defvar mastodon-tl--buffer-spec)  (defvar mastodon-tl--display-media-p) @@ -187,10 +206,14 @@ Status notifications are given when  (defun mastodon-notifications--format-note (note type)    "Format for a NOTE of TYPE."    (let* ((id (alist-get 'id note)) -         (profile-note (when (equal 'follow-request type) -                         (mastodon-tl--field -                          'note -                          (mastodon-tl--field 'account note)))) +         (profile-note +          (when (equal 'follow-request type) +            (let ((str (mastodon-tl--field +                        'note +                        (mastodon-tl--field 'account note)))) +              (if mastodon-notifications--profile-note-in-foll-reqs-max-length +                  (string-limit str mastodon-notifications--profile-note-in-foll-reqs-max-length) +                str))))           (status (mastodon-tl--field 'status note))           (follower (alist-get 'username (alist-get 'account note))))      (mastodon-notifications--insert-status @@ -223,10 +246,13 @@ Status notifications are given when                      'face 'default)                   (concat                    (propertize -                   (format "You have a follow request from... %s:\n" +                   (format "You have a follow request from... %s"                             follower)                     'face 'default) -                  (mastodon-notifications--comment-note-text body))))) +                  (when mastodon-notifications--profile-note-in-foll-reqs +                    (concat +                     ":\n" +                     (mastodon-notifications--comment-note-text body)))))))               ((or (eq type 'favourite)                    (eq type 'boost))                (mastodon-notifications--comment-note-text  | 
