Many thanks that you fixed #109 , it helped me view my slack and IRC messages in one buffer.
I just want to point out when using slack-message-custom-notifier, the arguments are not plain text/string as in you can plug it in alert but objects. So in order for me to get the team, room and message; I had to copy the code from the original alert notification and plug in the correct parameters.
I have no problem that the arguments are objects, but rather I had to go look at the source just to figure what they were. So maybe some documentation on the API objects might alleviate this confusion in using the custom notifier.
Either way, good job.
The text was updated successfully, but these errors were encountered:
My use case is to use the fringe alert instead of the popup since I find it somewhat mousy. As a fallback, I would also like it to be logged and displayed in the minibuffer with some color. I copied the base code and modified it accordingly:
(defun fn/slack-message-custom-notifier (message room team)
"My custom notication for slack given MESSAGE, ROOM and TEAM.
What I do is use the fringe to notify me instead of `libnotify'."
(when (and (not (slack-message-minep message team))
(or (slack-im-p room)
(and (slack-group-p room) (slack-mpim-p room))
(slack-room-subscribedp room team)
(string-match (format "@%s" (plist-get (oref team self) :name))
(or (slack-message-body message team) ""))))
(let* ((team-name (oref team name))
(room-name (slack-room-name room))
(text (slack-message-to-alert message team))
(user-name (slack-message-sender-name message team))
(out (fn/chat-log team-name room-name user-name text))) ;; My logging function
(fn/alert-color out ;; My generic fringe color alert.
(setq slack-message-custom-notifier #'fn/slack-message-custom-notifier