Function: erc-notifications-notify
erc-notifications-notify is a byte-compiled function defined in
erc-desktop-notifications.el.gz.
Signature
(erc-notifications-notify NICK MSG &optional PRIVP)
Documentation
Notify that NICK send some MSG, where PRIVP should be non-nil for PRIVMSGs.
This will replace the last notification sent with this function.
Source Code
;; Defined in /usr/src/emacs/lisp/erc/erc-desktop-notifications.el.gz
(defun erc-notifications-notify (nick msg &optional privp)
"Notify that NICK send some MSG, where PRIVP should be non-nil for PRIVMSGs.
This will replace the last notification sent with this function."
;; TODO: can we do this without PRIVP? (by "fixing" ERC's not
;; setting the current buffer to the existing query buffer)
(dbus-ignore-errors
(setq erc-notifications-last-notification
(let* ((channel (if privp (erc-get-buffer nick) (current-buffer)))
(title (format "%s in %s"
(erc-compat--xml-escape-string nick t)
channel))
(body (erc-compat--xml-escape-string (erc-controls-strip msg)
t)))
(funcall (cond ((featurep 'android)
#'android-notifications-notify)
((featurep 'haiku)
#'haiku-notifications-notify)
(t #'notifications-notify))
:bus erc-notifications-bus
:title title
:body body
:replaces-id erc-notifications-last-notification
:app-icon erc-notifications-icon
:actions '("default" "Switch to buffer")
:on-action (lambda (&rest _)
(pop-to-buffer channel)))))))