From 80eaae97b095bc44c97c3eb1b74de1aa02d2dedf Mon Sep 17 00:00:00 2001 From: ueno Date: Mon, 17 Jul 2006 00:21:48 +0000 Subject: [PATCH] * riece-commands.el (riece-command-join-channel): Simplified by using riece-server-opened. (riece-command-part-channel): Ditto. --- lisp/ChangeLog | 6 ++++++ lisp/riece-commands.el | 42 ++++++++++++++++++++---------------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c6b2e50..b6abd5b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2006-07-17 Daiki Ueno + + * riece-commands.el (riece-command-join-channel): Simplified by + using riece-server-opened. + (riece-command-part-channel): Ditto. + 2006-07-16 Daiki Ueno * riece.el (riece-save-variables-files): Place ";;; Do not edit diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el index 9aaec0b..84bffe8 100644 --- a/lisp/riece-commands.el +++ b/lisp/riece-commands.el @@ -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 -- 1.7.10.4