changeset 108767:471d9557d537

rcirc update. * lisp/net/rcirc.el (rcirc-server-alist): Add :pass. (rcirc-default-user-name): Change to "user". (rcirc-default-full-name): Change to "unknown". (rcirc-user-name-history): Add variable. (rcirc): When prompting for connection paramaters, also prompt for username and password. (rcirc-connect): Take a PASS argument. If PASS is non-nil, send value to server when connecting.
author Glenn Morris <rgm@gnu.org>
date Mon, 24 May 2010 20:35:31 -0700
parents 2f547b05b620
children 56c66753dd38
files lisp/ChangeLog lisp/net/rcirc.el
diffstat 2 files changed, 35 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon May 24 22:32:40 2010 -0400
+++ b/lisp/ChangeLog	Mon May 24 20:35:31 2010 -0700
@@ -1,3 +1,14 @@
+2010-05-25  Ryan Yeske  <rcyeske@gmail.com>
+
+	* net/rcirc.el (rcirc-server-alist): Add :pass.
+	(rcirc-default-user-name): Change to "user".
+	(rcirc-default-full-name): Change to "unknown".
+	(rcirc-user-name-history): Add variable.
+	(rcirc): When prompting for connection paramaters, also prompt for
+	username and password.
+	(rcirc-connect): Take a PASS argument.	If PASS is non-nil, send
+	value to server when connecting.
+
 2010-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* emacs-lisp/smie.el (smie-set-prec2tab): Check override before use.
--- a/lisp/net/rcirc.el	Mon May 24 22:32:40 2010 -0400
+++ b/lisp/net/rcirc.el	Mon May 24 20:35:31 2010 -0700
@@ -85,6 +85,10 @@
 VALUE must be a string.  If absent, `rcirc-default-full-name' is
 used.
 
+`:pass'
+
+VALUE must be a string.
+
 `:channels'
 
 VALUE must be a list of strings describing which channels to join
@@ -95,6 +99,7 @@
 					     (:port integer)
 					     (:user-name string)
 					     (:full-name string)
+					     (:pass string)
 					     (:channels (repeat string)))))
   :group 'rcirc)
 
@@ -108,14 +113,12 @@
   :type 'string
   :group 'rcirc)
 
-(defcustom rcirc-default-user-name (user-login-name)
+(defcustom rcirc-default-user-name "user"
   "Your user name sent to the server when connecting."
   :type 'string
   :group 'rcirc)
 
-(defcustom rcirc-default-full-name (if (string= (user-full-name) "")
-				       rcirc-default-user-name
-				     (user-full-name))
+(defcustom rcirc-default-full-name "unknown"
   "The full name sent to the server when connecting."
   :type 'string
   :group 'rcirc)
@@ -369,6 +372,9 @@
 (defvar rcirc-nick-name-history nil
   "History variable for \\[rcirc] call.")
 
+(defvar rcirc-user-name-history nil
+  "History variable for \\[rcirc] call.")
+
 ;;;###autoload
 (defun rcirc (arg)
   "Connect to all servers in `rcirc-server-alist'.
@@ -393,6 +399,12 @@
 				(or (plist-get server-plist :nick)
 				    rcirc-default-nick)
 				'rcirc-nick-name-history))
+	     (user-name (read-string "IRC Username: "
+                                     (or (plist-get server-plist :user-name)
+                                         rcirc-default-user-name)
+                                     'rcirc-user-name-history))
+	     (pass (read-passwd "IRC Password: " nil
+				(plist-get server-plist :pass)))
 	     (channels (split-string
 			(read-string "IRC Channels: "
 				     (mapconcat 'identity
@@ -400,7 +412,7 @@
 							   :channels)
 						" "))
 			"[, ]+" t)))
-	(rcirc-connect server port nick rcirc-default-user-name
+	(rcirc-connect server port nick user-name pass
 		       rcirc-default-full-name
 		       channels))
     ;; connect to servers in `rcirc-server-alist'
@@ -411,6 +423,7 @@
 	      (port (or (plist-get (cdr c) :port) rcirc-default-port))
 	      (user-name (or (plist-get (cdr c) :user-name)
 			     rcirc-default-user-name))
+              (pass (plist-get (cdr c) :pass))
 	      (full-name (or (plist-get (cdr c) :full-name)
 			     rcirc-default-full-name))
 	      (channels (plist-get (cdr c) :channels)))
@@ -421,7 +434,7 @@
 		  (setq connected p)))
 	      (if (not connected)
 		  (condition-case e
-		      (rcirc-connect server port nick user-name
+		      (rcirc-connect server port nick user-name pass
 				     full-name channels)
 		    (quit (message "Quit connecting to %s" server)))
 		(with-current-buffer (process-buffer connected)
@@ -453,8 +466,8 @@
 (defvar rcirc-process nil)
 
 ;;;###autoload
-(defun rcirc-connect (server &optional port nick user-name full-name
-			     startup-channels)
+(defun rcirc-connect (server &optional port nick user-name pass
+                             full-name startup-channels)
   (save-excursion
     (message "Connecting to %s..." server)
     (let* ((inhibit-eol-conversion)
@@ -503,10 +516,11 @@
       (add-hook 'auto-save-hook 'rcirc-log-write)
 
       ;; identify
+      (when pass
+        (rcirc-send-string process (concat "PASS " pass)))
       (rcirc-send-string process (concat "NICK " nick))
       (rcirc-send-string process (concat "USER " user-name
-                                      " hostname servername :"
-                                      full-name))
+                                         " 0 * :" full-name))
 
       ;; setup ping timer if necessary
       (unless rcirc-keepalive-timer