From: Magnus H. <leg...@us...> - 2007-08-06 17:08:20
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv6089 Modified Files: jabber-muc.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-373 Creator: Magnus Henoch <ma...@fr...> Don't call alerts for MUC history Index: jabber-muc.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-muc.el,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- jabber-muc.el 6 May 2007 14:53:11 -0000 1.68 +++ jabber-muc.el 6 Aug 2007 17:08:12 -0000 1.69 @@ -844,12 +844,18 @@ (run-hook-with-args-until-success 'printers xml-data type :printp)) (jabber-maybe-print-rare-time (ewoc-enter-last jabber-chat-ewoc (list type xml-data :time (current-time)))) - - (dolist (hook '(jabber-muc-hooks jabber-alert-muc-hooks)) - (run-hook-with-args hook - nick group (current-buffer) body-text - (funcall jabber-alert-muc-function - nick group (current-buffer) body-text)))))))) + + ;; ...except if the message is part of history, in which + ;; case we don't want an alert. + (let ((children-namespaces (mapcar (lambda (x) (jabber-xml-get-attribute x 'xmlns)) + (jabber-xml-node-children xml-data)))) + (unless (or (member "urn:xmpp:delay" children-namespaces) + (member "jabber:x:delay" children-namespaces)) + (dolist (hook '(jabber-muc-hooks jabber-alert-muc-hooks)) + (run-hook-with-args hook + nick group (current-buffer) body-text + (funcall jabber-alert-muc-function + nick group (current-buffer) body-text)))))))))) (defun jabber-muc-process-presence (jc presence) (let* ((from (jabber-xml-get-attribute presence 'from)) |