aboutsummaryrefslogtreecommitdiffstats
path: root/root_commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'root_commands.c')
-rw-r--r--root_commands.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/root_commands.c b/root_commands.c
index cf1c169c..7c54e272 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -979,6 +979,11 @@ static void cmd_chat( irc_t *irc, char **cmd )
irc_usermsg( irc, "Invalid account" );
return;
}
+ else if( !acc->prpl->chat_join )
+ {
+ irc_usermsg( irc, "Named chatrooms not supported on that account." );
+ return;
+ }
if( cmd[4] == NULL )
{
@@ -998,13 +1003,19 @@ static void cmd_chat( irc_t *irc, char **cmd )
channel = s;
}
- if( ( ic = irc_channel_new( irc, channel ) ) )
+ if( ( ic = irc_channel_new( irc, channel ) ) &&
+ set_setstr( &ic->set, "chat_type", "room" ) &&
+ set_setstr( &ic->set, "account", cmd[2] ) &&
+ set_setstr( &ic->set, "room", cmd[3] ) )
+ {
+ irc_usermsg( irc, "Chatroom successfully added." );
+ }
+ else
{
- struct irc_groupchat_stub *igs;
+ if( ic )
+ irc_channel_free( ic );
- ic->data = igs = g_new0( struct irc_groupchat_stub, 1 );
- igs->acc = acc;
- igs->room = g_strdup( cmd[3] );
+ irc_usermsg( irc, "Could not add chatroom." );
}
}
/*