diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2008-08-31 14:42:33 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2008-08-31 14:42:33 +0100 | 
| commit | 39f93f0ce1c0a179b51f5ff6474d57509e9e0d17 (patch) | |
| tree | 2471e302b8e5afff153cd1d8c831b9ec0c68f7ed /root_commands.c | |
| parent | 0e639f5e5245aa807764162b7f1928b641947658 (diff) | |
/join can now be used to join chatrooms, join_chat should not be used
anymore. /join should not be used for unnamed groupchats anymore, use
"chat with" instead.
Diffstat (limited to 'root_commands.c')
| -rw-r--r-- | root_commands.c | 25 | 
1 files changed, 24 insertions, 1 deletions
| diff --git a/root_commands.c b/root_commands.c index 83620173..97cadffe 100644 --- a/root_commands.c +++ b/root_commands.c @@ -1050,6 +1050,29 @@ static void cmd_chat( irc_t *irc, char **cmd )  	{  		cmd_set_real( irc, cmd + 1, cmd_chat_set_findhead );  	} +	else if( g_strcasecmp( cmd[1], "with" ) == 0 ) +	{ +		user_t *u; + +		if( !cmd[2] ) +		{ +			irc_usermsg( irc, "Not enough parameters given (need %d)", 2 ); +			return; +		} +		 +		if( ( u = user_find( irc, cmd[2] ) ) && u->ic && u->ic->acc->prpl->chat_with ) +		{ +			if( !u->ic->acc->prpl->chat_with( u->ic, u->handle ) ) +			{ +				irc_usermsg( irc, "(Possible) failure while trying to open " +				                  "a groupchat with %s.", u->nick ); +			} +		} +		else +		{ +			irc_usermsg( irc, "Can't open a groupchat with %s.", cmd[2] ); +		} +	}  	else  	{  		irc_usermsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "chat", cmd[1] ); @@ -1083,7 +1106,7 @@ static void cmd_chat( irc_t *irc, char **cmd )  	chat = cmd[2];  	if( cmd[3] )  	{ -		if( cmd[3][0] != '#' && cmd[3][0] != '&' ) +		if( strchr( CTYPES, cmd[3][0] ) == NULL )  			channel = g_strdup_printf( "&%s", cmd[3] );  		else  			channel = g_strdup( cmd[3] ); | 
