Add riece-button.el and riece-keyword.el.
[riece] / lisp / riece-000.el
index fde11c4..2900106 100644 (file)
@@ -27,6 +27,7 @@
 (require 'riece-misc)
 (require 'riece-filter)                        ;riece-default-handle-message
 (require 'riece-version)
+(require 'riece-commands)              ;riece-command-join
 
 (eval-when-compile
   (autoload 'riece-default-handle-numeric-reply "riece-filter"))
 
 (defun riece-handle-001-message (prefix number name string)
   "RPL_WELCOME \"Welcome to the Internet Relay Network <nick>!<user>@<host>\""
+  (if riece-real-server-name
+      (error "Already registered"))
   (setq riece-real-server-name prefix
        riece-real-nickname name
        riece-real-userhost nil)
   (riece-send-string (format "USERHOST %s\r\n" riece-real-nickname))
   (riece-insert-info
    (list riece-dialogue-buffer riece-others-buffer)
-   (concat (substring string 1) "\n")))
+   (concat (substring string 1) "\n"))
+  (if (equal riece-server-name "")
+      (message "Logging in to IRC server...done")
+    (message "Logging in to %s...done" riece-server-name))
+  (let ((channel-list riece-startup-channel-list))
+    (while channel-list
+      (if (listp (car channel-list))
+         (riece-command-join (riece-parse-identity (car (car channel-list)))
+                             (nth 1 (car channel-list)))
+       (riece-command-join (riece-parse-identity (car channel-list))))
+      (setq channel-list (cdr channel-list))))
+  (run-hooks 'riece-after-login-hook))
 
 (defun riece-handle-004-message (prefix number name string)
   "RPL_MYINFO \"<umodes> <chnlmodes>\""