From 34fa91691cc7c0c4a46e1582821188e74d5dfff8 Mon Sep 17 00:00:00 2001 From: Miguel de la Cruz Date: Wed, 1 Jun 2022 11:59:26 +0200 Subject: [PATCH] Make WS messages less invasive --- mattermost.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mattermost.el b/mattermost.el index 9e35814..b3f0067 100644 --- a/mattermost.el +++ b/mattermost.el @@ -105,7 +105,7 @@ if the user is not present" :on-message (lambda (ws frame) (let* ((text (websocket-frame-text frame)) (msg (json-parse-string text))) - (message "INCOMING> %s" msg))) + (lwarn 'mattermost :debug (format "INCOMING> %s" msg)))) :on-close (lambda (ws) (lwarn 'mattermost :error "websocket connection closed")))) @@ -215,13 +215,14 @@ user to check their status and select between them") (if (string-empty-p mattermost-host) ;; ToDo: throw error here (lwarn 'mattermost :error "`mattermost-host` cannot be empty")) - (mattermost-close) + (mattermost-disconnect) (let ((password (mattermost-read-password))) (mattermost-login mattermost-login-id password)) (mattermost-show-root)) -(defun mattermost-close () +(defun mattermost-disconnect () "Closes the connection with the Mattermost server" + (interactive) (unless (null mattermost-websocket) (websocket-close mattermost-websocket)) (setq mattermost-token nil