+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
(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)))
(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