summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2007-11-29 22:36:38 +0000
committerMichael Olson <mwolson@gnu.org>2007-11-29 22:36:38 +0000
commite09bf6d82435d6759b5f0eaf0462c3f2bb98319b (patch)
treec3fa68f916fa76607359f226e14ded643517e731
parentcb8ec4c5b5dd413f41f5a604794a4eeb573b7247 (diff)
downloademacs-e09bf6d82435d6759b5f0eaf0462c3f2bb98319b.tar.gz
Sync from upstream ERC
- Parse 307 (nick has identified) responses. - Only activate some things if the connection has been established.
-rw-r--r--lisp/erc/ChangeLog16
-rw-r--r--lisp/erc/erc-autoaway.el3
-rw-r--r--lisp/erc/erc-backend.el10
-rw-r--r--lisp/erc/erc-netsplit.el15
-rw-r--r--lisp/erc/erc-notify.el3
-rw-r--r--lisp/erc/erc-track.el5
-rw-r--r--lisp/erc/erc.el1
7 files changed, 42 insertions, 11 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index b7f40c39411..232e004602f 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-29 Giorgos Keramidas <keramida@ceid.upatras.gr>
+
+ * erc-backend.el, erc.el:
+ Parse 307 (nick has identified) responses.
+
2007-11-15 Juanma Barranquero <lekktu@gmail.com>
* erc.el (erc-open):
@@ -5,6 +10,17 @@
* erc-log.el (log):
* erc-match.el (erc-log-matches): Fix typos in docstrings.
+2007-11-11 Michael Olson <mwolson@gnu.org>
+
+ * 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 <mwolson@gnu.org>
* erc-compat.el (erc-set-write-file-functions): New compatibility
diff --git a/lisp/erc/erc-autoaway.el b/lisp/erc/erc-autoaway.el
index c70beb112e2..4c841387d7f 100644
--- a/lisp/erc/erc-autoaway.el
+++ b/lisp/erc/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/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 5b4e79fda32..338696f37d6 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -1564,6 +1564,16 @@ See `erc-display-server-message'." nil
(erc-display-message parsed 'notice 'active
's306 ?m (erc-response.contents parsed)))
+(define-erc-response-handler (307)
+ "Display nick-identified message." nil
+ (multiple-value-bind (nick user message)
+ (cdr (erc-response.command-args parsed))
+ (erc-display-message
+ parsed 'notice 'active 's307
+ ?n nick
+ ?m (mapconcat 'identity (cddr (erc-response.command-args parsed))
+ " "))))
+
(define-erc-response-handler (311 314)
"WHOIS/WHOWAS notices." nil
(let ((fname (erc-response.contents parsed))
diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el
index 83bc0dffc0c..b20b7ad738b 100644
--- a/lisp/erc/erc-netsplit.el
+++ b/lisp/erc/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/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el
index 9216631a9b4..34556a00d6c 100644
--- a/lisp/erc/erc-notify.el
+++ b/lisp/erc/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/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index ad3eaf73a4b..15de2094214 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/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)
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 497b6ffd396..ac9c3f6df9b 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -6205,6 +6205,7 @@ All windows are opened in the current frame."
(s303 . "Is online: %n")
(s305 . "%m")
(s306 . "%m")
+ (s307 . "%n %m")
(s311 . "%n is %f (%u@%h)")
(s312 . "%n is/was on server %s (%c)")
(s313 . "%n is an IRC operator")