11 Dec

Server password for rcirc.el

Monday December 11th 2006, 2:16 pm
Tags: , ,

A working patch against
rcirc.el from
Emacs CVS revision 1.30 to add support for server authentification. The
original patch from
http://www.emacswiki.org/cgi-bin/wiki/rcircServerAuth were broken and
moreover had several errors anyway.

? rcirc-pass.el.patch
Index: rcirc.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/net/rcirc.el,v
retrieving revision 1.30
diff -u -p -B -w -u -r1.30 rcirc.el
— rcirc.el    24 Nov 2006 10:33:22 -0000  1.30
+++ rcirc.el    11 Dec 2006 12:59:37 -0000
@@ -153,18 +153,20 @@ the window."
 Each element of the list is a list with a SERVER-REGEXP string
 and a method symbol followed by method specific arguments.

-The valid METHOD symbols are `nickserv’, `chanserv’ and
+The valid METHOD symbols are `nickserv’, `chanserv’,’server’ and
 `bitlbee’.

 The required ARGUMENTS for each METHOD symbol are:
   `nickserv’: NICK PASSWORD
   `chanserv’: NICK CHANNEL PASSWORD
   `bitlbee’: NICK PASSWORD
+  ’server’: NICK PASSWORD

 Example:
  ((\"freenode\" nickserv \"bob\" \"p455w0rd\")
   (\"freenode\" chanserv \"bob\" \"#bobland\" \"passwd99\")
-  (\"bitlbee\" bitlbee \"robert\" \"sekrit\"))"
(\"bitlbee\" bitlbee \"robert\" \"sekrit\")
+  (\"ctrlproxy\" server \"bob\" \"secret\"))"

   :type(alist :key-type (string :tag "Server")
               :value-type (choice (list :tag "NickServ"
                                      (const nickserv)
@@ -178,6 +180,10 @@ Example:
                                 (list :tag "BitlBee"
                                      (const bitlbee)
                                      (string :tag "Nick")
+                                     (string :tag "Password"))
+                                (list :tag "Server"
+                                     (const server)
+                                     (string :tag "Nick")
                                      (string :tag "Password"))))
   :group ‘rcirc)

@@ -397,6 +403,9 @@ If ARG is non-nil, prompt for a server t
       (make-local-variable ‘rcirc-last-server-message-time)
       (setq rcirc-last-server-message-time (current-time))

+      ;; send password before NICK command if available
+      (rcirc-authenticate)
+
       ;; identify
       (rcirc-send-string process (concat "NICK " nick))
       (rcirc-send-string process (concat "USER " user-name
@@ -2268,6 +2277,11 @@ Passwords are stored in `rcirc-authinfo’
                (rcirc-send-string
                 process
                 (concat "PRIVMSG &bitlbee :identify " (car args))))
+                ((equal method ’server)
+                 (message "Sending PASS command to %s" server)
+                 (rcirc-send-string
+                  process
+                  (concat "PASS " (car args))))
               (t
                (message "No %S authentication method defined"
                        method))))))))

0 Comments