Alexis Hazell | 18 Feb 11:19
Picon

PRIVMSG notification duplication

Hi all,

i've written my own ERC notification funtion:

    (defun erc-my-notify (proc parsed)
        (setq info (aref parsed 2))
        (setq sender (match-string (string-match "^[^!]+" info) info))
        (setq current-conv (match-string (string-match "^[^@]+" (buffer-name)) (buffer-name)))
        (if (not (string= current-conv sender))
            (shell-command "zenity --info --text='PRIVMSG received'"))
        1)

and added it to erc-server-PRIVMSG-functions:

    (add-hook 'erc-server-PRIVMSG-functions 'erc-my-notify t)

However, for some reason it gets called twice on each PRIVMSG. Any
suggestions as to what i'm doing wrong?

Thanks in anticipation,

Alexis.

Gmane