From: Magnus H. <leg...@us...> - 2008-03-30 18:32:00
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv23353 Modified Files: jabber-autoaway.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-475 Creator: Magnus Henoch <ma...@fr...> Fix autoaway WRT recent presence fix Index: jabber-autoaway.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-autoaway.el,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- jabber-autoaway.el 13 Mar 2007 20:02:46 -0000 1.5 +++ jabber-autoaway.el 30 Mar 2008 18:31:53 -0000 1.6 @@ -1,6 +1,6 @@ ;;; jabber-autoaway.el --- change status to away after idleness -;; Copyright (C) 2006 Magnus Henoch +;; Copyright (C) 2006, 2008 Magnus Henoch ;; Author: Magnus Henoch <ma...@fr...> @@ -90,11 +90,10 @@ The IGNORED argument is there so you can put this function in `jabber-post-connect-hooks'." (interactive) - (when jabber-autoaway-timer - (jabber-cancel-timer jabber-autoaway-timer)) - (setq jabber-autoaway-timer - (run-with-timer (* jabber-autoaway-timeout 60) nil #'jabber-autoaway-timer)) - (jabber-autoaway-message "Autoaway timer started")) + (unless jabber-autoaway-timer + (setq jabber-autoaway-timer + (run-with-timer (* jabber-autoaway-timeout 60) nil #'jabber-autoaway-timer)) + (jabber-autoaway-message "Autoaway timer started"))) (defun jabber-autoaway-stop () "Stop autoaway timer." @@ -145,9 +144,11 @@ (progn (setq jabber-autoaway-last-idle-time idle-time)) ;; But if it doesn't, go back to unidle state. + (jabber-autoaway-message "Back to unidle") ;; But don't mess with the user's custom presence. - (when (string= *jabber-current-status* jabber-autoaway-status) - (jabber-send-default-presence)) + (if (string= *jabber-current-status* jabber-autoaway-status) + (jabber-send-default-presence) + (jabber-autoaway-message "%S /= %S - not resetting presence" *jabber-current-status* jabber-autoaway-status)) (jabber-autoaway-start)))) (defun jabber-xprintidle-get-idle-time () |