erc-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Erc-commit] [commit][emacs22] erc-autoaway: Fix an introduced bug.


From: mwolson
Subject: [Erc-commit] [commit][emacs22] erc-autoaway: Fix an introduced bug.
Date: Sun, 14 Oct 2007 00:48:15 -0400

commit 7f75a654ec9717a92a1cbad11c25e5b6b7bb8e55
Author: Michael Olson <address@hidden>
Date:   Sat Jun 3 19:37:16 2006 +0000

    erc-autoaway: Fix an introduced bug.
    
    * erc-autoaway.el (autoaway): Use a more specific idle reset function.
      (erc-autoaway-reset-idle-user): New function that resets the idle state
      for user idle time.
      (erc-autoaway-reset-idle-irc): Renamed from `erc-autoaway-reset-idle'.
      Don't pass line to `erc-autoaway-set-away', since it is not used.
      (erc-autoaway-set-back): Remove line argument, since it is not used.
    git-archimport-id: address@hidden/erc--main--0--patch-5

diff --git a/ChangeLog b/ChangeLog
index c5af6a7..d63826f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,8 +14,13 @@
        (erc-autoaway-reestablish-idletimer, erc-autoaway-message):
        Docfix.
        (erc-autoaway-idle-seconds): Use erc-autoaway-idle-method.
-       (erc-autoaway-reset-idletime): Make the first argument optional so
-       that we can safely add this to post-command-hook.
+       (erc-autoaway-reset-idle-irc): Renamed from
+       `erc-autoaway-reset-idle'.  Don't pass line to
+       `erc-autoaway-set-away', since it is not used.
+       (erc-autoaway-reset-idle-user): New function that resets the idle
+       state for user idle time.
+       (erc-autoaway-set-back): Remove line argument, since it is not
+       used.
 
        * Makefile (upload): Make this work for Savannah uploads.
 
diff --git a/erc-autoaway.el b/erc-autoaway.el
index 518005d..1ce9583 100644
--- a/erc-autoaway.el
+++ b/erc-autoaway.el
@@ -87,19 +87,19 @@ set you no longer away.
 Related variables: `erc-public-away-p' and `erc-away-nickname'."
   ;; Enable:
   ((cond ((eq erc-autoaway-idle-method 'irc)
-         (add-hook 'erc-send-completed-hook 'erc-autoaway-reset-idletime)
-         (add-hook 'erc-server-001-functions 'erc-autoaway-reset-idletime))
+         (add-hook 'erc-send-completed-hook 'erc-autoaway-reset-idle-irc)
+         (add-hook 'erc-server-001-functions 'erc-autoaway-reset-idle-irc))
         ((eq erc-autoaway-idle-method 'user)
-         (add-hook 'post-command-hook 'erc-autoaway-reset-idletime))
+         (add-hook 'post-command-hook 'erc-autoaway-reset-idle-user))
         ((eq erc-autoaway-idle-method 'emacs)
          (erc-autoaway-reestablish-idletimer)))
    (add-hook 'erc-timer-hook 'erc-autoaway-possibly-set-away))
   ;; Disable:
   ((cond ((eq erc-autoaway-idle-method 'irc)
-         (remove-hook 'erc-send-completed-hook 'erc-autoaway-reset-idletime)
-         (remove-hook 'erc-server-001-functions 'erc-autoaway-reset-idletime))
+         (remove-hook 'erc-send-completed-hook 'erc-autoaway-reset-idle-irc)
+         (remove-hook 'erc-server-001-functions 'erc-autoaway-reset-idle-irc))
         ((eq erc-autoaway-idle-method 'user)
-         (remove-hook 'post-command-hook 'erc-autoaway-reset-idletime))
+         (remove-hook 'post-command-hook 'erc-autoaway-reset-idle-user))
         ((eq erc-autoaway-idle-method 'emacs)
          (erc-cancel-timer erc-autoaway-idletimer)
          (setq erc-autoaway-idletimer nil)))
@@ -167,17 +167,25 @@ in seconds."
 (defvar erc-autoaway-last-sent-time (erc-current-time)
   "The last time the user sent something.")
 
-(defun erc-autoaway-reset-idletime (&optional line &rest stuff)
-  "Reset the stored idletime for the user.
-This is one global variable since a user talking on one net can talk
-on another net too."
+(defun erc-autoaway-reset-idle-user (&rest stuff)
+  "Reset the stored user idle time.
+This is one global variable since a user talking on one net can
+talk on another net too."
+  (when erc-auto-discard-away
+    (erc-autoaway-set-back))
+  (setq erc-autoaway-last-sent-time (erc-current-time)))
+
+(defun erc-autoaway-reset-idle-irc (line &rest stuff)
+  "Reset the stored IRC idle time.
+This is one global variable since a user talking on one net can
+talk on another net too."
   (when (and erc-auto-discard-away
             (stringp line)
             (not (string-match erc-autoaway-no-auto-discard-regexp line)))
-    (erc-autoaway-set-back line))
+    (erc-autoaway-set-back))
   (setq erc-autoaway-last-sent-time (erc-current-time)))
 
-(defun erc-autoaway-set-back (line)
+(defun erc-autoaway-set-back ()
   "Discard the away state globally."
   (when (erc-away-p)
     (setq erc-autoaway-last-sent-time (erc-current-time))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]