summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-03-06 14:50:31 -0600
committerCraig Jennings <c@cjennings.net>2026-03-06 14:50:31 -0600
commit786171248678dc1769be1f24d4bc875761f8a451 (patch)
tree2c24a590a6da158f977b8a31fd0e7949c84a82be /modules
parentfc271461ac3b16ec161750335b5cb0bc81660639 (diff)
fix(slack): fix notification and mark-as-read bugs
Notifications silently failed: slack-room-im-p (nonexistent) replaced with slack-im-p; slack-message-to-string replaced with slack-message-body. Mark-as-read bound to nonexistent function; added cj/slack-mark-read-and-bury.
Diffstat (limited to 'modules')
-rw-r--r--modules/slack-config.el15
1 files changed, 12 insertions, 3 deletions
diff --git a/modules/slack-config.el b/modules/slack-config.el
index 5ff33917..067c94ff 100644
--- a/modules/slack-config.el
+++ b/modules/slack-config.el
@@ -93,13 +93,22 @@
MESSAGE is the incoming slack message, ROOM is the channel/DM,
TEAM is the slack team object."
(when (and (not (slack-message-minep message team))
- (or (slack-room-im-p room)
+ (or (slack-im-p room)
(slack-message-mentioned-p message)))
(let ((title (format "Slack: %s" (slack-room-display-name room team)))
- (body (slack-message-to-string message team)))
+ (body (slack-message-body message team)))
(start-process "slack-notify" nil
"notify" "info" title body))))
+(defun cj/slack-mark-read-and-bury ()
+ "Mark the current Slack channel as read and bury the buffer."
+ (interactive)
+ (when (and (boundp 'slack-current-buffer) slack-current-buffer)
+ (let ((ts (slack-buffer-latest-ts slack-current-buffer)))
+ (when ts
+ (slack-buffer-update-mark-request slack-current-buffer ts))))
+ (bury-buffer))
+
;; ------------------------------ Keybindings ----------------------------------
(defvar cj/slack-keymap (make-sparse-keymap)
@@ -117,7 +126,7 @@ TEAM is the slack team object."
(define-key cj/slack-keymap (kbd "!") #'slack-message-add-reaction)
(define-key cj/slack-keymap (kbd "@") #'slack-message-embed-mention)
(define-key cj/slack-keymap (kbd "#") #'slack-message-embed-channel)
-(define-key cj/slack-keymap (kbd "q") #'slack-buffer-mark-as-read-and-bury)
+(define-key cj/slack-keymap (kbd "q") #'cj/slack-mark-read-and-bury)
(define-key cj/slack-keymap (kbd "S") #'cj/slack-stop)
(which-key-add-keymap-based-replacements cj/slack-keymap