* riece-server.el (riece-open-server): Display "Logging in to
authorDaiki Ueno <ueno@unixuser.org>
Sat, 20 Sep 2003 00:41:46 +0000 (00:41 +0000)
committerDaiki Ueno <ueno@unixuser.org>
Sat, 20 Sep 2003 00:41:46 +0000 (00:41 +0000)
XXX..." message.
* riece-000.el (riece-handle-001-message): Clear "Logging in to
XXX..." message; call riece-after-login-hook.

lisp/ChangeLog
lisp/riece-000.el
lisp/riece-server.el

index 65019f7..9b42166 100644 (file)
@@ -1,3 +1,10 @@
+2003-09-20  Daiki Ueno  <ueno@unixuser.org>
+
+       * riece-server.el (riece-open-server): Display "Logging in to
+       XXX..." message.
+       * riece-000.el (riece-handle-001-message): Clear "Logging in to
+       XXX..." message; call riece-after-login-hook.
+
 2003-09-07  Daiki Ueno  <ueno@unixuser.org>
 
        * riece-unread.el (riece-unread-after-display-message-function):
index fde11c4..9a442f2 100644 (file)
 
 (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))
+  (run-hooks 'riece-after-login-hook))
 
 (defun riece-handle-004-message (prefix number name string)
   "RPL_MYINFO \"<umodes> <chnlmodes>\""
index 25d67a4..ba66fce 100644 (file)
@@ -125,22 +125,29 @@ the `riece-server-keyword-map' variable."
     (riece-process-send-string process string)))
 
 (defun riece-open-server (server server-name)
-  (if (equal server-name "")
-      (message "Connecting to IRC server...")
-    (message "Connecting to %s..." server-name))
   (riece-server-keyword-bind server
-    (let* (selective-display
-          (coding-system-for-read 'binary)
-          (coding-system-for-write 'binary)
-          (process
+    (let (selective-display
+         (coding-system-for-read 'binary)
+         (coding-system-for-write 'binary)
+         process)
+      (if (equal server-name "")
+         (message "Connecting to IRC server...")
+       (message "Connecting to %s..." server-name))
+      (setq process
            (funcall function (riece-server-process-name server-name)
                     (concat " *IRC*" server-name)
-                    host service)))
+                    host service))
+      (if (equal server-name "")
+         (message "Connecting to IRC server...done")
+       (message "Connecting to %s...done" server-name))
       (riece-reset-process-buffer process)
       (with-current-buffer (process-buffer process)
        (setq riece-server-name server-name))
       (set-process-sentinel process 'riece-sentinel)
       (set-process-filter process 'riece-filter)
+      (if (equal server-name "")
+         (message "Logging in to IRC server...")
+       (message "Logging in to %s..." server-name))
       (if (or password
              riece-reconnect-with-password)
          (riece-process-send-string process
@@ -159,10 +166,7 @@ the `riece-server-keyword-map' variable."
              riece-nick-accepted 'sent
              riece-coding-system coding))
       (setq riece-process-list
-           (cons process riece-process-list))))
-  (if (equal server-name "")
-      (message "Connecting to IRC server...done")
-    (message "Connecting to %s...done" server-name)))
+           (cons process riece-process-list)))))
 
 (defun riece-reset-process-buffer (process)
   (save-excursion