aboutsummaryrefslogtreecommitdiffstats
path: root/irc_commands.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2008-09-28 11:56:46 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2008-09-28 11:56:46 +0100
commite180c59a7796bb651b96ffaa5757e4688f1d3cc6 (patch)
treed754b1ebad712c26d4c5f4a490770e0f7ce0dba9 /irc_commands.c
parent2bebe15b447b84fd5705a021f73db609c336fd73 (diff)
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.
Diffstat (limited to 'irc_commands.c')
-rw-r--r--irc_commands.c12
1 files changed, 2 insertions, 10 deletions
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] );
- }
}
}