From f2f4f62cd6fa0149161fbb947584f41e774a10a7 Mon Sep 17 00:00:00 2001 From: "Ivan I. Ovchinnikov" Date: Sat, 21 Nov 2026 11:04:56 +0300 Subject: [PATCH] feat(ui): bold sender names in channel buffers - Add mattermost-sender-face (customizable bold face) - Use propertize in mattermost--format-post for sender names --- lisp/mattermost-channel.el | 7 +++++-- lisp/mattermost-custom.el | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/mattermost-channel.el b/lisp/mattermost-channel.el index 46c1010..94ec068 100644 --- a/lisp/mattermost-channel.el +++ b/lisp/mattermost-channel.el @@ -56,7 +56,7 @@ (message "[MM] Failed to load history: %S" (plist-get response :error))))))) (defun mattermost--format-post (post) - "Format a POST plist for display with multi-line support." + "Format a POST plist for display with multi-line support and bold sender." (let* ((msg-text (or (plist-get post :message) "")) (create-at (plist-get post :create_at)) (time-str (if create-at @@ -65,7 +65,10 @@ (sender (or (plist-get post :user_display_name) (plist-get post :user_id) "unknown"))) - (format "[%s] **%s:**\n%s\n" time-str sender msg-text))) + (concat + (format "[%s] **" time-str) + (propertize sender 'face 'mattermost-sender-face) + (format ":**\n%s\n" msg-text)))) (defun mattermost--render-channel-history (channel-name posts) "Render POSTS in the current channel buffer with CHANNEL-NAME." diff --git a/lisp/mattermost-custom.el b/lisp/mattermost-custom.el index 7a94da6..fac011c 100644 --- a/lisp/mattermost-custom.el +++ b/lisp/mattermost-custom.el @@ -42,4 +42,9 @@ If `inline', show replies in the main buffer." :type 'string :group 'mattermost) +(defface mattermost-sender-face + '((t (:weight bold))) + "Face used for message sender names in channel buffers." + :group 'mattermost) + (provide 'mattermost-custom)