erc-commit
[Top][All Lists]
Advanced

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

[Erc-commit] [commit][master] Only activate some things if the connectio


From: mwolson
Subject: [Erc-commit] [commit][master] Only activate some things if the connection has been established.
Date: Sat, 10 Nov 2007 19:21:17 -0500

commit 6a2386e2537148760f67ab65870e40461292271b
Author: Michael W. Olson <address@hidden>
Date:   Sat Nov 10 19:13:14 2007 -0500

    Only activate some things if the connection has been established.
    
    * erc-autoaway.el (erc-autoaway-possibly-set-away):
    * erc-netsplit.el (erc-netsplit-timer):
    * erc-notify.el (erc-notify-timer):
    * erc-track.el (erc-user-is-active): Only run if we have successfully
      established a connection to the server and have logged in.  I suspect
      that sending messages too soon may make some IRC servers not respond
      well, particularly when the network connection is iffy or subject to
      traffic-shaping.

diff --git a/ChangeLog b/ChangeLog
index 97d5100..e30a999 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-11-11  Michael Olson  <address@hidden>
+
+       * erc-autoaway.el (erc-autoaway-possibly-set-away):
+       * erc-netsplit.el (erc-netsplit-timer):
+       * erc-notify.el (erc-notify-timer):
+       * erc-track.el (erc-user-is-active): Only run if we have
+       successfully established a connection to the server and have
+       logged in.  I suspect that sending messages too soon may make some
+       IRC servers not respond well, particularly when the network
+       connection is iffy or subject to traffic-shaping.
+
 2007-11-01  Michael Olson  <address@hidden>
 
        * erc-compat.el (erc-set-write-file-functions): New compatibility
diff --git a/erc-autoaway.el b/erc-autoaway.el
index c70beb1..4c84138 100644
--- a/erc-autoaway.el
+++ b/erc-autoaway.el
@@ -248,7 +248,8 @@ exceeds `erc-autoaway-idle-seconds'."
   ;; A test for (erc-server-process-alive) is not necessary, because
   ;; this function is called from `erc-timer-hook', which is called
   ;; whenever the server sends something to the client.
-  (when (and erc-auto-set-away
+  (when (and erc-server-connected
+            erc-auto-set-away
             (not erc-autoaway-caused-away)
             (erc-autoaway-some-open-server-buffer))
     (let ((idle-time (erc-time-diff erc-autoaway-last-sent-time
diff --git a/erc-netsplit.el b/erc-netsplit.el
index 83bc0df..b20b7ad 100644
--- a/erc-netsplit.el
+++ b/erc-netsplit.el
@@ -173,13 +173,14 @@ join from that split has been detected or not.")
 
 (defun erc-netsplit-timer (now)
   "Clean cruft from `erc-netsplit-list' older than 10 minutes."
-  (dolist (elt erc-netsplit-list)
-    (when (> (erc-time-diff (cadr elt) now) 600)
-      (when erc-netsplit-debug
-       (erc-display-message
-        nil 'notice (current-buffer)
-        (concat "Netsplit: Removing " (car elt))))
-      (setq erc-netsplit-list (delq elt erc-netsplit-list)))))
+  (when erc-server-connected
+    (dolist (elt erc-netsplit-list)
+      (when (> (erc-time-diff (cadr elt) now) 600)
+       (when erc-netsplit-debug
+         (erc-display-message
+          nil 'notice (current-buffer)
+          (concat "Netsplit: Removing " (car elt))))
+       (setq erc-netsplit-list (delq elt erc-netsplit-list))))))
 
 ;;;###autoload
 (defun erc-cmd-WHOLEFT ()
diff --git a/erc-notify.el b/erc-notify.el
index 9216631..34556a0 100644
--- a/erc-notify.el
+++ b/erc-notify.el
@@ -111,7 +111,8 @@ changes."
 ;;;; Timer handler
 
 (defun erc-notify-timer (now)
-  (when (and erc-notify-list
+  (when (and erc-server-connected
+            erc-notify-list
             (> (erc-time-diff
                 erc-last-ison-time now)
                erc-notify-interval))
diff --git a/erc-track.el b/erc-track.el
index ad3eaf7..15de209 100644
--- a/erc-track.el
+++ b/erc-track.el
@@ -665,8 +665,9 @@ only consider active buffers visible.")
 
 (defun erc-user-is-active (&rest ignore)
   "Set `erc-buffer-activity'."
-  (setq erc-buffer-activity (erc-current-time))
-  (erc-track-modified-channels))
+  (when erc-server-connected
+    (setq erc-buffer-activity (erc-current-time))
+    (erc-track-modified-channels)))
 
 (defun erc-track-get-buffer-window (buffer frame-param)
   (if (eq frame-param 'selected-visible)




reply via email to

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