aboutsummaryrefslogtreecommitdiffstats
path: root/root_commands.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2007-07-01 13:20:23 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2007-07-01 13:20:23 +0100
commit7bf4326f7a9b2a2aec8b292ecbc876d4349d2624 (patch)
treecbc0fd6326dc02d7522818cb40625b80f8b22b45 /root_commands.c
parenta3d5766eba9b1225d41cede5d817a48c3a3e0b7d (diff)
Better groupchat channel name generation/verification.
Diffstat (limited to 'root_commands.c')
-rw-r--r--root_commands.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/root_commands.c b/root_commands.c
index 9965c2e8..8ffebd8e 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -911,7 +911,10 @@ static void cmd_join_chat( irc_t *irc, char **cmd )
chat = cmd[2];
if( cmd[3] )
{
- channel = g_strdup( cmd[3] );
+ if( channel[0] != '#' && channel[0] != '&' )
+ channel = g_strdup_printf( "&%s", cmd[3] );
+ else
+ channel = g_strdup( cmd[3] );
}
else
{
@@ -928,7 +931,7 @@ static void cmd_join_chat( irc_t *irc, char **cmd )
if( cmd[3] && cmd[4] && cmd[5] )
password = cmd[5];
- if( channel[0] != '#' && channel[0] != '&' )
+ if( !nick_ok( channel + 1 ) )
{
irc_usermsg( irc, "Invalid channel name: %s", channel );
g_free( channel );