* riece-handle.el (riece-handle-quit-message): Pass
[riece] / lisp / riece-handle.el
index f08270d..f19f62c 100644 (file)
 (require 'riece-naming)
 (require 'riece-signal)
 (require 'riece-mode)
+(require 'riece-000)
+(require 'riece-200)
+(require 'riece-300)
+(require 'riece-400)
+(require 'riece-500)
+
+(defun riece-default-handle-numeric-reply
+  (client-prefix prefix number name string)
+  (riece-insert
+   (list riece-dialogue-buffer riece-others-buffer)
+   (concat client-prefix
+          (riece-concat-server-name
+           (mapconcat #'identity (riece-split-parameters string) " "))
+          "\n")))
 
 (defun riece-handle-nick-message (prefix string)
   (let* ((old (riece-prefix-nickname prefix))
     (riece-naming-assert-rename old new)
     (if (riece-identity-member old-identity riece-current-channels)
        (setq channels (cons new channels)))
-    (riece-insert-change (mapcar
-                         (lambda (channel)
-                           (riece-channel-buffer (riece-make-identity
-                                                  channel riece-server-name)))
-                         channels)
+    (riece-insert-change (delq nil (mapcar
+                                   (lambda (channel)
+                                     (riece-channel-buffer
+                                      (riece-make-identity
+                                       channel riece-server-name)))
+                                   channels))
                         (format "%s -> %s\n"
                                 (riece-format-identity old-identity t)
                                 (riece-format-identity new-identity t)))
         (user-identity (riece-make-identity user riece-server-name)))
     ;; If you are talking with the user, quit it.
     (if (riece-identity-member user-identity riece-current-channels)
-       (riece-part-channel user))
+       (riece-part-channel user-identity))
     (setq pointer channels)
     (while pointer
       (riece-naming-assert-part user (car pointer))
       (setq pointer (cdr pointer)))
     (let ((buffers
-          (mapcar
-           (lambda (channel)
-             (riece-channel-buffer (riece-make-identity channel
-                                                        riece-server-name)))
-           channels)))
+          (delq nil (mapcar
+                     (lambda (channel)
+                       (riece-channel-buffer (riece-make-identity
+                                              channel riece-server-name)))
+                     channels))))
       (riece-insert-change
        buffers
        (concat
       (riece-naming-assert-part user (car pointer))
       (setq pointer (cdr pointer)))
     (let ((buffers
-          (mapcar
-           (lambda (channel)
-             (riece-channel-buffer (riece-make-identity channel
-                                                        riece-server-name)))
-           channels)))
+          (delq nil (mapcar
+                     (lambda (channel)
+                       (riece-channel-buffer (riece-make-identity
+                                              channel riece-server-name)))
+                     channels))))
       (riece-insert-change
        buffers
        (concat