feat(ui): bold sender names in channel buffers
- Add mattermost-sender-face (customizable bold face) - Use propertize in mattermost--format-post for sender names
This commit is contained in:
@@ -56,7 +56,7 @@
|
|||||||
(message "[MM] Failed to load history: %S" (plist-get response :error)))))))
|
(message "[MM] Failed to load history: %S" (plist-get response :error)))))))
|
||||||
|
|
||||||
(defun mattermost--format-post (post)
|
(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) ""))
|
(let* ((msg-text (or (plist-get post :message) ""))
|
||||||
(create-at (plist-get post :create_at))
|
(create-at (plist-get post :create_at))
|
||||||
(time-str (if create-at
|
(time-str (if create-at
|
||||||
@@ -65,7 +65,10 @@
|
|||||||
(sender (or (plist-get post :user_display_name)
|
(sender (or (plist-get post :user_display_name)
|
||||||
(plist-get post :user_id)
|
(plist-get post :user_id)
|
||||||
"unknown")))
|
"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)
|
(defun mattermost--render-channel-history (channel-name posts)
|
||||||
"Render POSTS in the current channel buffer with CHANNEL-NAME."
|
"Render POSTS in the current channel buffer with CHANNEL-NAME."
|
||||||
|
|||||||
@@ -42,4 +42,9 @@ If `inline', show replies in the main buffer."
|
|||||||
:type 'string
|
:type 'string
|
||||||
:group 'mattermost)
|
:group 'mattermost)
|
||||||
|
|
||||||
|
(defface mattermost-sender-face
|
||||||
|
'((t (:weight bold)))
|
||||||
|
"Face used for message sender names in channel buffers."
|
||||||
|
:group 'mattermost)
|
||||||
|
|
||||||
(provide 'mattermost-custom)
|
(provide 'mattermost-custom)
|
||||||
|
|||||||
Reference in New Issue
Block a user