# HG changeset patch # User Michael Olson # Date 1196375798 0 # Node ID 11b4896b439ac3fd3d2af9e4ec50798251263121 # Parent 936ce2c5fcbecae120db9ffd04050e52facf641b Sync from upstream ERC - Parse 307 (nick has identified) responses. - Only activate some things if the connection has been established. diff -r 936ce2c5fcbe -r 11b4896b439a lisp/erc/ChangeLog --- a/lisp/erc/ChangeLog Thu Nov 29 21:57:25 2007 +0000 +++ b/lisp/erc/ChangeLog Thu Nov 29 22:36:38 2007 +0000 @@ -1,3 +1,8 @@ +2007-11-29 Giorgos Keramidas + + * erc-backend.el, erc.el: + Parse 307 (nick has identified) responses. + 2007-11-15 Juanma Barranquero * 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 + + * 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 * erc-compat.el (erc-set-write-file-functions): New compatibility diff -r 936ce2c5fcbe -r 11b4896b439a lisp/erc/erc-autoaway.el --- a/lisp/erc/erc-autoaway.el Thu Nov 29 21:57:25 2007 +0000 +++ b/lisp/erc/erc-autoaway.el Thu Nov 29 22:36:38 2007 +0000 @@ -248,7 +248,8 @@ ;; 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 -r 936ce2c5fcbe -r 11b4896b439a lisp/erc/erc-backend.el --- a/lisp/erc/erc-backend.el Thu Nov 29 21:57:25 2007 +0000 +++ b/lisp/erc/erc-backend.el Thu Nov 29 22:36:38 2007 +0000 @@ -1564,6 +1564,16 @@ (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 -r 936ce2c5fcbe -r 11b4896b439a lisp/erc/erc-netsplit.el --- a/lisp/erc/erc-netsplit.el Thu Nov 29 21:57:25 2007 +0000 +++ b/lisp/erc/erc-netsplit.el Thu Nov 29 22:36:38 2007 +0000 @@ -173,13 +173,14 @@ (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 -r 936ce2c5fcbe -r 11b4896b439a lisp/erc/erc-notify.el --- a/lisp/erc/erc-notify.el Thu Nov 29 21:57:25 2007 +0000 +++ b/lisp/erc/erc-notify.el Thu Nov 29 22:36:38 2007 +0000 @@ -111,7 +111,8 @@ ;;;; 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 -r 936ce2c5fcbe -r 11b4896b439a lisp/erc/erc-track.el --- a/lisp/erc/erc-track.el Thu Nov 29 21:57:25 2007 +0000 +++ b/lisp/erc/erc-track.el Thu Nov 29 22:36:38 2007 +0000 @@ -665,8 +665,9 @@ (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 -r 936ce2c5fcbe -r 11b4896b439a lisp/erc/erc.el --- a/lisp/erc/erc.el Thu Nov 29 21:57:25 2007 +0000 +++ b/lisp/erc/erc.el Thu Nov 29 22:36:38 2007 +0000 @@ -6205,6 +6205,7 @@ (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")