This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "emacs-jabber".
The branch, master has been updated
via c6c3af7f967901d6a8fb4ad70671bb5c5365b4bd (commit)
from 05340c6ad725a701dd7d157938263906977e4714 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c6c3af7f967901d6a8fb4ad70671bb5c5365b4bd
Author: Evgenii Terechkov <ev...@al...>
Date: Wed Jul 10 23:04:50 2013 +0800
Fix for autoaway presense spamming. Thanks to lioka@altlinux for bugreport.
diff --git a/jabber-autoaway.el b/jabber-autoaway.el
index 9e4cbdc..625dc2e 100644
--- a/jabber-autoaway.el
+++ b/jabber-autoaway.el
@@ -156,24 +156,25 @@ Return nil on error."
(defun jabber-autoaway-maybe-unidle ()
(let ((idle-time (jabber-autoaway-get-idle-time)))
(jabber-autoaway-message "Idle for %d seconds" idle-time)
- ;; As long as idle time increases monotonically, stay idle.
- (if (> idle-time jabber-autoaway-last-idle-time)
- (progn
- ;; Has "Xa timeout" passed?
- (if (and (> jabber-autoaway-xa-timeout 0) (> idle-time (* 60 jabber-autoaway-xa-timeout)))
- ;; iIf so, mark ourselves xa.
- (jabber-autoaway-set-idle t))
- (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.
- (if (or (string= *jabber-current-status* jabber-autoaway-status) (string= *jabber-current-status* jabber-autoaway-xa-status))
- (jabber-send-default-presence)
- (progn
- (jabber-send-presence jabber-default-show *jabber-current-status* jabber-default-priority)
- (jabber-autoaway-message "%S /= %S - not resetting presence" *jabber-current-status* jabber-autoaway-status)))
- (jabber-autoaway-stop)
- (jabber-autoaway-start))))
+ (if (member *jabber-current-show* '("xa" "away"))
+ ;; As long as idle time increases monotonically, stay idle.
+ (if (> idle-time jabber-autoaway-last-idle-time)
+ (progn
+ ;; Has "Xa timeout" passed?
+ (if (and (> jabber-autoaway-xa-timeout 0) (> idle-time (* 60 jabber-autoaway-xa-timeout)))
+ ;; iIf so, mark ourselves xa.
+ (jabber-autoaway-set-idle t))
+ (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.
+ (if (or (string= *jabber-current-status* jabber-autoaway-status) (string= *jabber-current-status* jabber-autoaway-xa-status))
+ (jabber-send-default-presence)
+ (progn
+ (jabber-send-presence jabber-default-show *jabber-current-status* jabber-default-priority)
+ (jabber-autoaway-message "%S /= %S - not resetting presence" *jabber-current-status* jabber-autoaway-status)))
+ (jabber-autoaway-stop)
+ (jabber-autoaway-start)))))
(defun jabber-xprintidle-get-idle-time ()
"Get idle time through the xprintidle program."
-----------------------------------------------------------------------
Summary of changes:
jabber-autoaway.el | 37 +++++++++++++++++++------------------
1 files changed, 19 insertions(+), 18 deletions(-)
hooks/post-receive
--
emacs-jabber
|