From 0cb35b46179ef78bc02f71fe1e6fb90fe7f50890 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sun, 1 Aug 2021 08:36:16 -0500 Subject: [PATCH] Change: (ement-room-send-event-callback) Message only when :debug --- ement-room.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ement-room.el b/ement-room.el index 35c5e97..9e9819d 100644 --- a/ement-room.el +++ b/ement-room.el @@ -662,8 +662,12 @@ mentioning the ROOM and CONTENT." (when content (setf message (concat message (format " Event content: %S" content)))) (display-warning 'ement-room-send-event-callback message)) - (message "Message sent to room %S: %S" - (ement-room-display-name room) (alist-get "body" content nil nil #'equal))))) + (when (eq :debug warning-minimum-log-level) + ;; HACK: Mildly abuse `warning-minimum-log-level' by using it to control whether + ;; successfully sent events display a message. This is really only needed for + ;; debugging (until adding local echo), and using actual warnings would be too much. + (message "Message sent to room %S: %S" + (ement-room-display-name room) (alist-get "body" content nil nil #'equal)))))) (defun ement-room-edit-message () "Edit message at point.