From e180c59a7796bb651b96ffaa5757e4688f1d3cc6 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 28 Sep 2008 11:56:46 +0100 Subject: Fixed irc_cmd_join(). Giving a more proper response to invalid channel names, and checking if an account is on-line before attempting to join one of its chatrooms. --- irc_commands.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'irc_commands.c') diff --git a/irc_commands.c b/irc_commands.c index 8941b0e9..71a8fb3e 100644 --- a/irc_commands.c +++ b/irc_commands.c @@ -196,19 +196,11 @@ static void irc_cmd_join( irc_t *irc, char **cmd ) user_t *u; if( strchr( CTYPES, cmd[1][0] ) == NULL || cmd[1][1] == 0 ) - { - irc_reply( irc, 403, "%s :No such channel", cmd[1] ); - return; - } - - if( ( c = chat_bychannel( irc, cmd[1] ) ) ) - { + irc_reply( irc, 479, "%s :Invalid channel name", cmd[1] ); + else if( ( c = chat_bychannel( irc, cmd[1] ) ) && c->acc && c->acc->ic ) chat_join( irc, c ); - } else - { irc_reply( irc, 403, "%s :No such channel", cmd[1] ); - } } } -- cgit v1.2.3