From 21df465e4b017b9a80db7bfefd2369f7bfe6cb00 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Wed, 5 Nov 2014 12:56:12 +0200 Subject: [PATCH] Remove custom erc notifications code It should be replaced with the use of something like https://github.com/jwiegley/alert --- modules/prelude-erc.el | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/modules/prelude-erc.el b/modules/prelude-erc.el index 49fcf67..2179ef6 100644 --- a/modules/prelude-erc.el +++ b/modules/prelude-erc.el @@ -78,18 +78,6 @@ ;; set different dictionaries by different servers/channels ;;(setq erc-spelling-dictionaries '(("#emacs" "american"))) -;; TODO - replace this with use of notify.el -;; Notify my when someone mentions my nick. -(defun call-libnotify (matched-type nick msg) - (let* ((cmsg (split-string (clean-message msg))) - (nick (first (split-string nick "!"))) - (msg (mapconcat 'identity (rest cmsg) " "))) - (shell-command-to-string - (format "notify-send -u critical '%s says:' '%s'" nick msg)))) - -(when (eq system-type 'linux) - (add-hook 'erc-text-matched-hook 'call-libnotify)) - (defvar erc-notify-nick-alist nil "Alist of nicks and the last time they tried to trigger a notification") @@ -115,20 +103,6 @@ that can occur between two notifications. The default is (push (cons nick cur-time) erc-notify-nick-alist) t))) -;; private message notification -(defun erc-notify-on-private-msg (proc parsed) - (let ((nick (car (erc-parse-user (erc-response.sender parsed)))) - (target (car (erc-response.command-args parsed))) - (msg (erc-response.contents parsed))) - (when (and (erc-current-nick-p target) - (not (erc-is-message-ctcp-and-not-action-p msg)) - (erc-notify-allowed-p nick)) - (shell-command-to-string - (format "notify-send -u critical '%s says:' '%s'" nick msg)) - nil))) - -(add-hook 'erc-server-PRIVMSG-functions 'erc-notify-on-private-msg) - ;; autoaway setup (setq erc-auto-discard-away t) (setq erc-autoaway-idle-seconds 600)