diff --git a/mattermost.el b/mattermost.el index da3dc9a..ffb049b 100644 --- a/mattermost.el +++ b/mattermost.el @@ -113,9 +113,9 @@ conform to a post plist" "Processes a websocket posted message" (let* ((channel-name (plist-get (plist-get msg :data) :channel_name)) (channel-display-name (plist-get (plist-get msg :data) :channel_display_name)) - (chanb (or (get-buffer (format "> %s <" channel-name)) - (get-buffer (format "> %s <" channel-display-name)))) - (post (mattermost--ws-posted-to-post msg))) + (post (mattermost--ws-posted-to-post msg)) + (channel-id (plist-get post :channel_id)) + (chanb (plist-get mattermost-buffers (mattermost-string->keyword channel-id)))) (if (not (null chanb)) (with-current-buffer chanb (save-excursion