diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-06-05 23:32:36 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-06-05 23:32:36 +0100 | 
| commit | 5a75d1586478f78446b6c78b161572fc7cabe4d9 (patch) | |
| tree | dc0d9edb7da103ce60229b5118db4a5f29821bba /root_commands.c | |
| parent | f5d87ea5e4db1864cc9dd95c295f166af9944014 (diff) | |
Chatroom improvements. Merged chatroom stub into normal chatroom stuff,
restored "chat add" behaviour a little bit better (don't clean up a
channel when its room disappears, just disconnect it from the groupchat).
Diffstat (limited to 'root_commands.c')
| -rw-r--r-- | root_commands.c | 21 | 
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." );  		}  	}  	/* | 
