Index: chat.c
===================================================================
--- chat.c	(revision 0e639f5e5245aa807764162b7f1928b641947658)
+++ chat.c	(revision 39f93f0ce1c0a179b51f5ff6474d57509e9e0d17)
@@ -139,5 +139,5 @@
 int chat_chanok( char *a )
 {
-	if( strchr( "&#", a[0] ) != NULL )
+	if( strchr( CTYPES, a[0] ) != NULL )
 		return nick_ok( a + 1 );
 	else
Index: irc.c
===================================================================
--- irc.c	(revision 0e639f5e5245aa807764162b7f1928b641947658)
+++ irc.c	(revision 39f93f0ce1c0a179b51f5ff6474d57509e9e0d17)
@@ -781,5 +781,7 @@
 	irc_reply( irc,   3, ":%s", IRCD_INFO );
 	irc_reply( irc,   4, "%s %s %s %s", irc->myhost, BITLBEE_VERSION, UMODES UMODES_PRIV, CMODES );
-	irc_reply( irc,   5, "PREFIX=(ov)@+ CHANTYPES=#& CHANMODES=,,,%s NICKLEN=%d NETWORK=BitlBee CASEMAPPING=rfc1459 MAXTARGETS=1 WATCH=128 :are supported by this server", CMODES, MAX_NICK_LENGTH - 1 );
+	irc_reply( irc,   5, "PREFIX=(ov)@+ CHANTYPES=%s CHANMODES=,,,%s NICKLEN=%d NETWORK=BitlBee "
+	                     "CASEMAPPING=rfc1459 MAXTARGETS=1 WATCH=128 :are supported by this server",
+	                     CTYPES, CMODES, MAX_NICK_LENGTH - 1 );
 	irc_motd( irc );
 	irc->umode[0] = '\0';
@@ -1022,5 +1024,5 @@
 	user_t *u = NULL;
 	
-	if( *nick == '#' || *nick == '&' )
+	if( strchr( CTYPES, *nick ) )
 	{
 		if( !( c = irc_chat_by_channel( irc, nick ) ) )
Index: irc.h
===================================================================
--- irc.h	(revision 0e639f5e5245aa807764162b7f1928b641947658)
+++ irc.h	(revision 39f93f0ce1c0a179b51f5ff6474d57509e9e0d17)
@@ -38,4 +38,5 @@
 #define CMODE "t"
 #define UMODE "s"
+#define CTYPES "&#"
 
 typedef enum
@@ -96,5 +97,4 @@
 
 #include "user.h"
-// #include "nick.h"
 
 extern GSList *irc_connection_list;
Index: irc_commands.c
===================================================================
--- irc_commands.c	(revision 0e639f5e5245aa807764162b7f1928b641947658)
+++ irc_commands.c	(revision 39f93f0ce1c0a179b51f5ff6474d57509e9e0d17)
@@ -125,5 +125,5 @@
 static void irc_cmd_mode( irc_t *irc, char **cmd )
 {
-	if( *cmd[1] == '#' || *cmd[1] == '&' )
+	if( strchr( CTYPES, *cmd[1] ) )
 	{
 		if( cmd[2] )
@@ -193,24 +193,25 @@
 	else if( cmd[1] )
 	{
-		if( ( cmd[1][0] == '#' || cmd[1][0] == '&' ) && cmd[1][1] )
-		{
-			user_t *u = user_find( irc, cmd[1] + 1 );
-			
-			if( u && u->ic && u->ic->acc->prpl->chat_with )
-			{
-				irc_reply( irc, 403, "%s :Initializing groupchat in a different channel", cmd[1] );
-				
-				if( !u->ic->acc->prpl->chat_with( u->ic, u->handle ) )
-				{
-					irc_usermsg( irc, "Could not open a groupchat with %s.", u->nick );
-				}
-			}
-			else if( u )
-			{
-				irc_reply( irc, 403, "%s :Groupchats are not possible with %s", cmd[1], cmd[1]+1 );
-			}
-			else
-			{
-				irc_reply( irc, 403, "%s :No such nick", cmd[1] );
+		struct groupchat *gc;
+		struct chat *c;
+		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] ) ) )
+		{
+			char *nick = set_getstr( &c->set, "nick" );
+			
+			if( nick == NULL )
+				nick = irc->nick;
+			
+			if( ( gc = c->acc->prpl->chat_join( c->acc->ic, c->handle, nick, NULL ) ) )
+			{
+				g_free( gc->channel );
+				gc->channel = g_strdup( c->channel );
 			}
 		}
Index: root_commands.c
===================================================================
--- root_commands.c	(revision 0e639f5e5245aa807764162b7f1928b641947658)
+++ root_commands.c	(revision 39f93f0ce1c0a179b51f5ff6474d57509e9e0d17)
@@ -1051,4 +1051,27 @@
 		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
 	{
@@ -1084,5 +1107,5 @@
 	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
