diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon-profile.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index d3b840e..e21c3dd 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -553,6 +553,15 @@ FIELDS means provide a fields vector fetched by other means." (when (not (equal :json-false x)) (setq result x))))) +(defun mastodon-profile--render-roles (roles) + "Return a propertized string of badges for ROLES." + (mapconcat + (lambda (role) + (propertize + (alist-get 'name role) + 'face `(:box t :foreground ,(alist-get 'color role)))) + roles)) + (defun mastodon-profile--make-profile-buffer-for (account endpoint-type update-function &optional no-reblogs headers) "Display profile of ACCOUNT, using ENDPOINT-TYPE and UPDATE-FUNCTION. @@ -603,6 +612,10 @@ HEADERS means also fetch link headers for pagination." (mastodon-profile--image-from-account account 'header_static) "\n" (propertize .display_name 'face 'mastodon-display-name-face) + ;; roles + (when .roles + (concat " " + (mastodon-profile--render-roles .roles))) "\n" (propertize (concat "@" .acct) 'face 'default) (if (equal .locked t) |