aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeniz Dogan2011-03-05 16:40:50 +0100
committerDeniz Dogan2011-03-05 16:40:50 +0100
commit77f63d3050876a786fd031676d2780ee7b10221b (patch)
tree899acf1892f17da1b1580b8390c42ebc2dd49827
parent72d2c2e3b9fb11f19d58ab20e4760cebbe120350 (diff)
downloademacs-77f63d3050876a786fd031676d2780ee7b10221b.tar.gz
emacs-77f63d3050876a786fd031676d2780ee7b10221b.zip
* lisp/net/rcirc.el: Add QuakeNet authentication support.
(rcirc-authinfo, rcirc-check-auth-status) (rcirc-authenticate): Support QuakeNet.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/net/rcirc.el57
2 files changed, 42 insertions, 21 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cc0f051d419..fb0e2f923c4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,11 @@
12011-03-05 Deniz Dogan <deniz.a.m.dogan@gmail.com> 12011-03-05 Deniz Dogan <deniz.a.m.dogan@gmail.com>
2 2
3 * net/rcirc.el: Add QuakeNet authentication support.
4 (rcirc-authinfo, rcirc-check-auth-status)
5 (rcirc-authenticate): Support QuakeNet.
6
72011-03-05 Deniz Dogan <deniz.a.m.dogan@gmail.com>
8
3 * net/rcirc.el: Add functionality to authenticate before 9 * net/rcirc.el: Add functionality to authenticate before
4 autojoining channels. 10 autojoining channels.
5 (rcirc-authenticate-before-join): New option. 11 (rcirc-authenticate-before-join): New option.
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 3bdaf83d7a9..1e3ee91092d 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -204,12 +204,14 @@ The ARGUMENTS for each METHOD symbol are:
204 `nickserv': NICK PASSWORD [NICKSERV-NICK] 204 `nickserv': NICK PASSWORD [NICKSERV-NICK]
205 `chanserv': NICK CHANNEL PASSWORD 205 `chanserv': NICK CHANNEL PASSWORD
206 `bitlbee': NICK PASSWORD 206 `bitlbee': NICK PASSWORD
207 `quakenet': ACCOUNT PASSWORD
207 208
208Examples: 209Examples:
209 ((\"freenode\" nickserv \"bob\" \"p455w0rd\") 210 ((\"freenode\" nickserv \"bob\" \"p455w0rd\")
210 (\"freenode\" chanserv \"bob\" \"#bobland\" \"passwd99\") 211 (\"freenode\" chanserv \"bob\" \"#bobland\" \"passwd99\")
211 (\"bitlbee\" bitlbee \"robert\" \"sekrit\") 212 (\"bitlbee\" bitlbee \"robert\" \"sekrit\")
212 (\"dal.net\" nickserv \"bob\" \"sekrit\" \"NickServ@services.dal.net\"))" 213 (\"dal.net\" nickserv \"bob\" \"sekrit\" \"NickServ@services.dal.net\")
214 (\"quakenet.org\" quakenet \"bobby\" \"sekrit\"))"
213 :type '(alist :key-type (string :tag "Server") 215 :type '(alist :key-type (string :tag "Server")
214 :value-type (choice (list :tag "NickServ" 216 :value-type (choice (list :tag "NickServ"
215 (const nickserv) 217 (const nickserv)
@@ -223,7 +225,11 @@ Examples:
223 (list :tag "BitlBee" 225 (list :tag "BitlBee"
224 (const bitlbee) 226 (const bitlbee)
225 (string :tag "Nick") 227 (string :tag "Nick")
226 (string :tag "Password")))) 228 (string :tag "Password"))
229 (list :tag "QuakeNet"
230 (const quakenet)
231 (string :tag "Account")
232 (string :tag "Password"))))
227 :group 'rcirc) 233 :group 'rcirc)
228 234
229(defcustom rcirc-auto-authenticate-flag t 235(defcustom rcirc-auto-authenticate-flag t
@@ -2506,8 +2512,10 @@ the only argument."
2506 (format "You are now identified for \C-b%s\C-b." rcirc-nick) 2512 (format "You are now identified for \C-b%s\C-b." rcirc-nick)
2507 "Password accepted - you are now recognized." 2513 "Password accepted - you are now recognized."
2508 ))) 2514 )))
2509 ;; place for other methods 2515 (and ;; quakenet
2510 ) 2516 (string= sender "Q")
2517 (string= target rcirc-nick)
2518 (string-match message "\\`You are now logged in as .+\\.\\'")))
2511 (setq rcirc-user-authenticated t) 2519 (setq rcirc-user-authenticated t)
2512 (run-hook-with-args 'rcirc-authenticated-hook process) 2520 (run-hook-with-args 'rcirc-authenticated-hook process)
2513 (remove-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t)))))) 2521 (remove-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t))))))
@@ -2756,26 +2764,33 @@ Passwords are stored in `rcirc-authinfo' (which see)."
2756 (nick (caddr i)) 2764 (nick (caddr i))
2757 (method (cadr i)) 2765 (method (cadr i))
2758 (args (cdddr i))) 2766 (args (cdddr i)))
2759 (when (and (string-match server rcirc-server) 2767 (when (and (string-match server rcirc-server))
2760 (string-match nick rcirc-nick)) 2768 (if (and (memq method '(nickserv chanserv bitlbee))
2761 (cond ((equal method 'nickserv) 2769 (string-match nick rcirc-nick))
2762 (rcirc-send-privmsg 2770 ;; the following methods rely on the user's nickname.
2763 process 2771 (case method
2772 (nickserv
2773 (rcirc-send-privmsg
2774 process
2764 (or (cadr args) "NickServ") 2775 (or (cadr args) "NickServ")
2765 (concat "identify " (car args)))) 2776 (concat "IDENTIFY " (car args))))
2766 ((equal method 'chanserv) 2777 (chanserv
2767 (rcirc-send-privmsg 2778 (rcirc-send-privmsg
2768 process 2779 process
2769 "ChanServ" 2780 "ChanServ"
2770 (format "identify %s %s" (car args) (cadr args)))) 2781 (format "IDENTIFY %s %s" (car args) (cadr args))))
2771 ((equal method 'bitlbee) 2782 (bitlbee
2772 (rcirc-send-privmsg 2783 (rcirc-send-privmsg
2773 process 2784 process
2774 "&bitlbee" 2785 "&bitlbee"
2775 (concat "identify " (car args)))) 2786 (concat "IDENTIFY " (car args)))))
2776 (t 2787 ;; quakenet authentication doesn't rely on the user's nickname.
2777 (message "No %S authentication method defined" 2788 ;; the variable `nick' here represents the Q account name.
2778 method)))))))) 2789 (when (eq method 'quakenet)
2790 (rcirc-send-privmsg
2791 process
2792 "Q@CServe.quakenet.org"
2793 (format "AUTH %s %s" nick (car args))))))))))
2779 2794
2780(defun rcirc-handler-INVITE (process sender args text) 2795(defun rcirc-handler-INVITE (process sender args text)
2781 (rcirc-print process sender "INVITE" nil (mapconcat 'identity args " ") t)) 2796 (rcirc-print process sender "INVITE" nil (mapconcat 'identity args " ") t))