ERC: Sync changes from upstream.

This commit is contained in:
Michael Olson 2008-01-10 03:51:14 +00:00
parent f9adf05bac
commit 712e2b05e1
3 changed files with 56 additions and 45 deletions

View file

@ -3,6 +3,21 @@
* erc-ibuffer.el (erc-channel-modes): * erc-ibuffer.el (erc-channel-modes):
Pass mode-name through format-mode-line Pass mode-name through format-mode-line
2007-12-16 Diane Murray <disumu@x3y2z1.net>
* erc-services.el (erc-nickserv-alist): Removed autodetect regexp,
added identified regexp for OFTC.
(erc-nickserv-identification-autodetect): Make sure success-regex
is non-nil.
(erc-nickserv-identify-autodetect): Make sure identify-regex is
non-nil. Doc fix.
2007-12-13 Diane Murray <disumu@x3y2z1.net>
* erc-backend.el (PRIVMSG, QUIT, TOPIC, WALLOPS, 376, 004, 221)
(312, 315, 319, 330, 331, 333, 367, 368, 391, 405, 406, 412)
(421, 432, 433, 437, 442, 461, 474, 477, 482, 431): Doc fix.
2007-12-09 Michael Olson <mwolson@gnu.org> 2007-12-09 Michael Olson <mwolson@gnu.org>
* erc-services.el (erc-nickserv-alist): Fix regexps for GRnet. * erc-services.el (erc-nickserv-alist): Fix regexps for GRnet.

View file

@ -1349,7 +1349,7 @@ add things to `%s' instead."
(erc-update-mode-line)))) (erc-update-mode-line))))
(define-erc-response-handler (PRIVMSG NOTICE) (define-erc-response-handler (PRIVMSG NOTICE)
nil nil "Handle private messages, including messages in channels." nil
(let ((sender-spec (erc-response.sender parsed)) (let ((sender-spec (erc-response.sender parsed))
(cmd (erc-response.command parsed)) (cmd (erc-response.command parsed))
(tgt (car (erc-response.command-args parsed))) (tgt (car (erc-response.command-args parsed)))
@ -1413,7 +1413,7 @@ add things to `%s' instead."
(add-hook 'erc-server-PRIVMSG-functions 'erc-auto-query) (add-hook 'erc-server-PRIVMSG-functions 'erc-auto-query)
(define-erc-response-handler (QUIT) (define-erc-response-handler (QUIT)
nil nil "Another user has quit IRC." nil
(let ((reason (erc-response.contents parsed)) (let ((reason (erc-response.contents parsed))
bufs) bufs)
(multiple-value-bind (nick login host) (multiple-value-bind (nick login host)
@ -1426,7 +1426,7 @@ add things to `%s' instead."
?h host ?r reason)))) ?h host ?r reason))))
(define-erc-response-handler (TOPIC) (define-erc-response-handler (TOPIC)
nil nil "The channel topic has changed." nil
(let* ((ch (first (erc-response.command-args parsed))) (let* ((ch (first (erc-response.command-args parsed)))
(topic (erc-trim-string (erc-response.contents parsed))) (topic (erc-trim-string (erc-response.contents parsed)))
(time (format-time-string "%T %m/%d/%y" (current-time)))) (time (format-time-string "%T %m/%d/%y" (current-time))))
@ -1439,7 +1439,7 @@ add things to `%s' instead."
?c ch ?T topic)))) ?c ch ?T topic))))
(define-erc-response-handler (WALLOPS) (define-erc-response-handler (WALLOPS)
nil nil "Display a WALLOPS message." nil
(let ((message (erc-response.contents parsed))) (let ((message (erc-response.contents parsed)))
(multiple-value-bind (nick login host) (multiple-value-bind (nick login host)
(erc-parse-user (erc-response.sender parsed)) (erc-parse-user (erc-response.sender parsed))
@ -1465,12 +1465,12 @@ add things to `%s' instead."
(erc-response.contents parsed))) (erc-response.contents parsed)))
(define-erc-response-handler (376 422) (define-erc-response-handler (376 422)
nil nil "End of MOTD/MOTD is missing." nil
(erc-server-MOTD proc parsed) (erc-server-MOTD proc parsed)
(erc-connection-established proc parsed)) (erc-connection-established proc parsed))
(define-erc-response-handler (004) (define-erc-response-handler (004)
nil nil "Display the server's identification." nil
(multiple-value-bind (server-name server-version) (multiple-value-bind (server-name server-version)
(cdr (erc-response.command-args parsed)) (cdr (erc-response.command-args parsed))
(setq erc-server-version server-version) (setq erc-server-version server-version)
@ -1510,7 +1510,7 @@ A server may send more than one 005 message."
(erc-display-message parsed 'notice proc line))) (erc-display-message parsed 'notice proc line)))
(define-erc-response-handler (221) (define-erc-response-handler (221)
nil nil "Display the current user modes." nil
(let* ((nick (first (erc-response.command-args parsed))) (let* ((nick (first (erc-response.command-args parsed)))
(modes (mapconcat 'identity (modes (mapconcat 'identity
(cdr (erc-response.command-args parsed)) " "))) (cdr (erc-response.command-args parsed)) " ")))
@ -1596,7 +1596,7 @@ See `erc-display-server-message'." nil
?n nick ?f fname ?u user ?h host)))) ?n nick ?f fname ?u user ?h host))))
(define-erc-response-handler (312) (define-erc-response-handler (312)
nil nil "Server name response in WHOIS." nil
(multiple-value-bind (nick server-host) (multiple-value-bind (nick server-host)
(cdr (erc-response.command-args parsed)) (cdr (erc-response.command-args parsed))
(erc-display-message (erc-display-message
@ -1614,7 +1614,7 @@ See `erc-display-server-message'." nil
;; 318 - End of WHOIS list ;; 318 - End of WHOIS list
;; 323 - End of channel LIST ;; 323 - End of channel LIST
;; 369 - End of WHOWAS ;; 369 - End of WHOWAS
nil nil "End of WHO/WHOIS/LIST/WHOWAS notices." nil
(ignore proc parsed)) (ignore proc parsed))
(define-erc-response-handler (317) (define-erc-response-handler (317)
@ -1635,7 +1635,7 @@ See `erc-display-server-message'." nil
?n nick ?i (erc-sec-to-time (string-to-number seconds-idle)))))) ?n nick ?i (erc-sec-to-time (string-to-number seconds-idle))))))
(define-erc-response-handler (319) (define-erc-response-handler (319)
nil nil "Channel names in WHOIS response." nil
(erc-display-message (erc-display-message
parsed 'notice 'active 's319 parsed 'notice 'active 's319
?n (second (erc-response.command-args parsed)) ?n (second (erc-response.command-args parsed))
@ -1683,7 +1683,7 @@ See `erc-display-server-message'." nil
's329 ?c channel ?t (format-time-string "%A %Y/%m/%d %X" time)))) 's329 ?c channel ?t (format-time-string "%A %Y/%m/%d %X" time))))
(define-erc-response-handler (330) (define-erc-response-handler (330)
nil nil "Nick is authed as (on Quakenet network)." nil
;; FIXME: I don't know what the magic numbers mean. Mummy, make ;; FIXME: I don't know what the magic numbers mean. Mummy, make
;; the magic numbers go away. ;; the magic numbers go away.
;; No seriously, I have no clue about the format of this command, ;; No seriously, I have no clue about the format of this command,
@ -1699,10 +1699,9 @@ See `erc-display-server-message'." nil
?n nick ?a authmsg ?i authaccount))) ?n nick ?a authmsg ?i authaccount)))
(define-erc-response-handler (331) (define-erc-response-handler (331)
"Channel topic." nil "No topic set for channel." nil
(let ((channel (second (erc-response.command-args parsed))) (let ((channel (second (erc-response.command-args parsed)))
(topic (erc-response.contents parsed))) (topic (erc-response.contents parsed)))
;; FIXME: why don't we do anything with the topic? -- Lawrence 2004/05/10
(erc-display-message parsed 'notice (erc-get-buffer channel proc) (erc-display-message parsed 'notice (erc-get-buffer channel proc)
's331 ?c channel))) 's331 ?c channel)))
@ -1715,8 +1714,7 @@ See `erc-display-server-message'." nil
's332 ?c channel ?T topic))) 's332 ?c channel ?T topic)))
(define-erc-response-handler (333) (define-erc-response-handler (333)
;; Who set the topic, and when "Who set the topic, and when." nil
nil nil
(multiple-value-bind (channel nick time) (multiple-value-bind (channel nick time)
(cdr (erc-response.command-args parsed)) (cdr (erc-response.command-args parsed))
(setq time (format-time-string "%T %Y/%m/%d" (setq time (format-time-string "%T %Y/%m/%d"
@ -1766,7 +1764,7 @@ See `erc-display-server-message'." nil
(erc-channel-end-receiving-names))) (erc-channel-end-receiving-names)))
(define-erc-response-handler (367) (define-erc-response-handler (367)
"Channel ban list entries" nil "Channel ban list entries." nil
(multiple-value-bind (channel banmask setter time) (multiple-value-bind (channel banmask setter time)
(cdr (erc-response.command-args parsed)) (cdr (erc-response.command-args parsed))
;; setter and time are not standard ;; setter and time are not standard
@ -1781,7 +1779,7 @@ See `erc-display-server-message'." nil
?b banmask)))) ?b banmask))))
(define-erc-response-handler (368) (define-erc-response-handler (368)
"End of channel ban list" nil "End of channel ban list." nil
(let ((channel (second (erc-response.command-args parsed)))) (let ((channel (second (erc-response.command-args parsed))))
(erc-display-message parsed 'notice 'active 's368 (erc-display-message parsed 'notice 'active 's368
?c channel))) ?c channel)))
@ -1797,7 +1795,7 @@ See `erc-display-server-message'." nil
's379 ?c from ?f to))) 's379 ?c from ?f to)))
(define-erc-response-handler (391) (define-erc-response-handler (391)
"Server's time string" nil "Server's time string." nil
(erc-display-message (erc-display-message
parsed 'notice 'active parsed 'notice 'active
's391 ?s (second (erc-response.command-args parsed)) 's391 ?s (second (erc-response.command-args parsed))
@ -1824,56 +1822,47 @@ See `erc-display-server-message'." nil
(define-erc-response-handler (405) (define-erc-response-handler (405)
;; Can't join that many channels. "Can't join that many channels." nil
nil nil
(erc-display-message parsed '(notice error) 'active (erc-display-message parsed '(notice error) 'active
's405 ?c (second (erc-response.command-args parsed)))) 's405 ?c (second (erc-response.command-args parsed))))
(define-erc-response-handler (406) (define-erc-response-handler (406)
;; No such nick "No such nick." nil
nil nil
(erc-display-message parsed '(notice error) 'active (erc-display-message parsed '(notice error) 'active
's406 ?n (second (erc-response.command-args parsed)))) 's406 ?n (second (erc-response.command-args parsed))))
(define-erc-response-handler (412) (define-erc-response-handler (412)
;; No text to send "No text to send." nil
nil nil
(erc-display-message parsed '(notice error) 'active 's412)) (erc-display-message parsed '(notice error) 'active 's412))
(define-erc-response-handler (421) (define-erc-response-handler (421)
;; Unknown command "Unknown command." nil
nil nil
(erc-display-message parsed '(notice error) 'active 's421 (erc-display-message parsed '(notice error) 'active 's421
?c (second (erc-response.command-args parsed)))) ?c (second (erc-response.command-args parsed))))
(define-erc-response-handler (432) (define-erc-response-handler (432)
;; Bad nick. "Bad nick." nil
nil nil
(erc-display-message parsed '(notice error) 'active 's432 (erc-display-message parsed '(notice error) 'active 's432
?n (second (erc-response.command-args parsed)))) ?n (second (erc-response.command-args parsed))))
(define-erc-response-handler (433) (define-erc-response-handler (433)
;; Login-time "nick in use" "Login-time \"nick in use\"." nil
nil nil
(erc-nickname-in-use (second (erc-response.command-args parsed)) (erc-nickname-in-use (second (erc-response.command-args parsed))
"already in use")) "already in use"))
(define-erc-response-handler (437) (define-erc-response-handler (437)
;; Nick temporarily unavailable (IRCnet) "Nick temporarily unavailable (on IRCnet)." nil
nil nil
(let ((nick/channel (second (erc-response.command-args parsed)))) (let ((nick/channel (second (erc-response.command-args parsed))))
(unless (erc-channel-p nick/channel) (unless (erc-channel-p nick/channel)
(erc-nickname-in-use nick/channel "temporarily unavailable")))) (erc-nickname-in-use nick/channel "temporarily unavailable"))))
(define-erc-response-handler (442) (define-erc-response-handler (442)
;; Not on channel "Not on channel." nil
nil nil
(erc-display-message parsed '(notice error) 'active 's442 (erc-display-message parsed '(notice error) 'active 's442
?c (second (erc-response.command-args parsed)))) ?c (second (erc-response.command-args parsed))))
(define-erc-response-handler (461) (define-erc-response-handler (461)
;; Not enough params for command. "Not enough parameters for command." nil
nil nil
(erc-display-message parsed '(notice error) 'active 's461 (erc-display-message parsed '(notice error) 'active 's461
?c (second (erc-response.command-args parsed)) ?c (second (erc-response.command-args parsed))
?m (erc-response.contents parsed))) ?m (erc-response.contents parsed)))
@ -1887,7 +1876,7 @@ See `erc-display-server-message'." nil
(erc-response.contents parsed))) (erc-response.contents parsed)))
(define-erc-response-handler (474) (define-erc-response-handler (474)
"Banned from channel errors" nil "Banned from channel errors." nil
(erc-display-message parsed '(notice error) nil (erc-display-message parsed '(notice error) nil
(intern (format "s%s" (intern (format "s%s"
(erc-response.command parsed))) (erc-response.command parsed)))
@ -1906,14 +1895,14 @@ See `erc-display-server-message'." nil
(erc-cmd-JOIN channel key))))) (erc-cmd-JOIN channel key)))))
(define-erc-response-handler (477) (define-erc-response-handler (477)
nil nil "Channel doesn't support modes." nil
(let ((channel (second (erc-response.command-args parsed))) (let ((channel (second (erc-response.command-args parsed)))
(message (erc-response.contents parsed))) (message (erc-response.contents parsed)))
(erc-display-message parsed 'notice (erc-get-buffer channel proc) (erc-display-message parsed 'notice (erc-get-buffer channel proc)
(format "%s: %s" channel message)))) (format "%s: %s" channel message))))
(define-erc-response-handler (482) (define-erc-response-handler (482)
nil nil "You need to be a channel operator to do that." nil
(let ((channel (second (erc-response.command-args parsed))) (let ((channel (second (erc-response.command-args parsed)))
(message (erc-response.contents parsed))) (message (erc-response.contents parsed)))
(erc-display-message parsed '(error notice) 'active 's482 (erc-display-message parsed '(error notice) 'active 's482
@ -1935,7 +1924,9 @@ See `erc-display-server-message'." nil
;; 491 - No O-lines for your host ;; 491 - No O-lines for your host
;; 501 - Unknown MODE flag ;; 501 - Unknown MODE flag
;; 502 - Cannot change mode for other users ;; 502 - Cannot change mode for other users
nil nil "Generic display of server error messages.
See `erc-display-error-notice'." nil
(erc-display-error-notice (erc-display-error-notice
parsed parsed
(intern (format "s%s" (erc-response.command parsed))))) (intern (format "s%s" (erc-response.command parsed)))))

View file

@ -227,6 +227,8 @@ Example of use:
"IDENTIFY" nil nil nil) "IDENTIFY" nil nil nil)
(freenode (freenode
"NickServ!NickServ@services." "NickServ!NickServ@services."
;; freenode also accepts a password at login, see the `erc'
;; :password argument.
"/msg\\s-NickServ\\s-IDENTIFY\\s-<password>" "/msg\\s-NickServ\\s-IDENTIFY\\s-<password>"
"NickServ" "NickServ"
"IDENTIFY" nil nil "IDENTIFY" nil nil
@ -249,9 +251,11 @@ Example of use:
"IDENTIFY" nil "SQUERY" nil) "IDENTIFY" nil "SQUERY" nil)
(OFTC (OFTC
"NickServ!services@services.oftc.net" "NickServ!services@services.oftc.net"
"type\\s-/msg\\s-NickServ\\s-IDENTIFY\\s-password." ;; OFTC's NickServ doesn't ask you to identify anymore.
nil
"NickServ" "NickServ"
"IDENTIFY" nil nil nil) "IDENTIFY" nil nil
"You\\s-are\\s-successfully\\s-identified\\s-as\\s-")
(QuakeNet (QuakeNet
nil nil nil nil
"Q@CServe.quakenet.org" "Q@CServe.quakenet.org"
@ -334,15 +338,15 @@ If this is the case, run `erc-nickserv-identified-hook'."
;; continue only if we're sure it's the real nickserv for this network ;; continue only if we're sure it's the real nickserv for this network
;; and it's told us we've successfully identified ;; and it's told us we've successfully identified
(when (and sender (equal sspec sender) (when (and sender (equal sspec sender)
success-regex
(string-match success-regex msg)) (string-match success-regex msg))
(erc-log "NickServ IDENTIFY success notification detected") (erc-log "NickServ IDENTIFY success notification detected")
(run-hook-with-args 'erc-nickserv-identified-hook network nick) (run-hook-with-args 'erc-nickserv-identified-hook network nick)
nil))) nil)))
(defun erc-nickserv-identify-autodetect (proc parsed) (defun erc-nickserv-identify-autodetect (proc parsed)
"Check for a NickServ identify request everytime a notice is received. "Identify to NickServ when an identify request is received.
Make sure it is the real NickServ for this network and that it has Make sure it is the real NickServ for this network.
specifically asked the user to IDENTIFY.
If `erc-prompt-for-nickserv-password' is non-nil, prompt the user for the If `erc-prompt-for-nickserv-password' is non-nil, prompt the user for the
password for this nickname, otherwise try to send it automatically." password for this nickname, otherwise try to send it automatically."
(unless (and (null erc-nickserv-passwords) (unless (and (null erc-nickserv-passwords)
@ -356,6 +360,7 @@ password for this nickname, otherwise try to send it automatically."
;; continue only if we're sure it's the real nickserv for this network ;; continue only if we're sure it's the real nickserv for this network
;; and it's asked us to identify ;; and it's asked us to identify
(when (and sender (equal sspec sender) (when (and sender (equal sspec sender)
identify-regex
(string-match identify-regex msg)) (string-match identify-regex msg))
(erc-log "NickServ IDENTIFY request detected") (erc-log "NickServ IDENTIFY request detected")
(erc-nickserv-call-identify-function nick) (erc-nickserv-call-identify-function nick)