[cl-irc-devel] [PATCH 1/6] Make mode optional in `mode' command

Julien Danjou julien at danjou.info
Sun Jan 13 14:04:18 UTC 2013


If you just want to retrieve the mode of a channel, you don't have to pass a
mode argument at all, and you'll get a RPL_CHANNELMODEIS in return.

Signed-off-by: Julien Danjou <julien at danjou.info>
---
 command.lisp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/command.lisp b/command.lisp
index aac445b..c167561 100644
--- a/command.lisp
+++ b/command.lisp
@@ -9,7 +9,7 @@
 (defgeneric nick (connection new-nickname))
 (defgeneric user- (connection username mode &optional realname))
 (defgeneric oper (connection name password))
-(defgeneric mode (connection nickname mode))
+(defgeneric mode (connection nickname &optional mode))
 (defgeneric op (connection channel nickname))
 (defgeneric deop (connection channel nickname))
 (defgeneric voice (connection channel user))
@@ -103,7 +103,7 @@ registered."
 (defmethod oper ((connection connection) (name string) (password string))
   (send-irc-message connection :oper name password))
 
-(defmethod mode ((connection connection) (nickname string) (mode string))
+(defmethod mode ((connection connection) (nickname string) &optional mode)
   (send-irc-message connection :mode nickname mode))
 
 ;; utility functions not part of the RFCs
-- 
1.8.1





More information about the cl-irc-devel mailing list