* riece-commands.el (riece-command-join-channel): Simplified by
authorueno <ueno>
Mon, 17 Jul 2006 00:21:48 +0000 (00:21 +0000)
committerueno <ueno>
Mon, 17 Jul 2006 00:21:48 +0000 (00:21 +0000)
using riece-server-opened.
(riece-command-part-channel): Ditto.

lisp/ChangeLog
lisp/riece-commands.el

index c6b2e50..b6abd5b 100644 (file)
@@ -1,3 +1,9 @@
+2006-07-17  Daiki Ueno  <ueno@unixuser.org>
+
+       * riece-commands.el (riece-command-join-channel): Simplified by
+       using riece-server-opened.
+       (riece-command-part-channel): Ditto.
+
 2006-07-16  Daiki Ueno  <ueno@unixuser.org>
 
        * riece.el (riece-save-variables-files): Place ";;; Do not edit
index 9aaec0b..84bffe8 100644 (file)
@@ -443,17 +443,16 @@ the layout to the selected layout-name."
     (next-line 1)))
 
 (defun riece-command-join-channel (target key)
-  (let ((process (riece-server-process (riece-identity-server target))))
-    (unless process
-      (error "%s" (substitute-command-keys
-                  "Type \\[riece-command-open-server] to open server.")))
-    (riece-send-string (if key
-                          (format "JOIN %s :%s\r\n"
-                                  (riece-identity-prefix target)
-                                  key)
-                        (format "JOIN %s\r\n"
-                                (riece-identity-prefix target)))
-                      target)))
+  (unless (riece-server-opened (riece-identity-server target))
+    (error "%s" (substitute-command-keys
+                "Type \\[riece-command-open-server] to open server.")))
+  (riece-send-string (if key
+                        (format "JOIN %s :%s\r\n"
+                                (riece-identity-prefix target)
+                                key)
+                      (format "JOIN %s\r\n"
+                              (riece-identity-prefix target)))
+                    target))
 
 (defun riece-command-join-partner (target)
   (let ((pointer (riece-identity-member target riece-current-channels)))
@@ -484,17 +483,16 @@ the layout to the selected layout-name."
        (riece-command-join-partner target)))))
 
 (defun riece-command-part-channel (target message)
-  (let ((process (riece-server-process (riece-identity-server target))))
-    (unless process
-      (error "%s" (substitute-command-keys
-                  "Type \\[riece-command-open-server] to open server.")))
-    (riece-send-string (if message
-                          (format "PART %s :%s\r\n"
-                                  (riece-identity-prefix target)
-                                  message)
-                        (format "PART %s\r\n"
-                                (riece-identity-prefix target)))
-                      target)))
+  (unless (riece-server-opened (riece-identity-server target))
+    (error "%s" (substitute-command-keys
+                "Type \\[riece-command-open-server] to open server.")))
+  (riece-send-string (if message
+                        (format "PART %s :%s\r\n"
+                                (riece-identity-prefix target)
+                                message)
+                      (format "PART %s\r\n"
+                              (riece-identity-prefix target)))
+                    target))
 
 (defun riece-command-part (target &optional message)
   (interactive