Index: protocols/msn/msn.c
===================================================================
--- protocols/msn/msn.c	(revision 0fd8559c4a6ad84ad0852e07c4ba2e50b2fdf0ad)
+++ protocols/msn/msn.c	(revision fa29d09342c79b886efacee4cfc3078be5f5a722)
@@ -241,7 +241,7 @@
 }
 
-static int msn_chat_send( struct gaim_connection *gc, int id, char *message )
-{
-	struct msn_switchboard *sb = msn_sb_by_id( gc, id );
+static int msn_chat_send( struct conversation *c, char *message )
+{
+	struct msn_switchboard *sb = msn_sb_by_chat( c );
 	
 	if( sb )
@@ -251,7 +251,7 @@
 }
 
-static void msn_chat_invite( struct gaim_connection *gc, int id, char *msg, char *who )
-{
-	struct msn_switchboard *sb = msn_sb_by_id( gc, id );
+static void msn_chat_invite( struct conversation *c, char *msg, char *who )
+{
+	struct msn_switchboard *sb = msn_sb_by_chat( c );
 	char buf[1024];
 	
@@ -263,7 +263,7 @@
 }
 
-static void msn_chat_leave( struct gaim_connection *gc, int id )
-{
-	struct msn_switchboard *sb = msn_sb_by_id( gc, id );
+static void msn_chat_leave( struct conversation *c )
+{
+	struct msn_switchboard *sb = msn_sb_by_chat( c );
 	
 	if( sb )
@@ -271,5 +271,5 @@
 }
 
-static int msn_chat_open( struct gaim_connection *gc, char *who )
+static struct conversation *msn_chat_open( struct gaim_connection *gc, char *who )
 {
 	struct msn_switchboard *sb;
@@ -280,6 +280,5 @@
 	{
 		debug( "Converting existing switchboard to %s to a groupchat", who );
-		msn_sb_to_chat( sb );
-		return( 1 );
+		return msn_sb_to_chat( sb );
 	}
 	else
@@ -292,8 +291,5 @@
 			g_snprintf( buf, sizeof( buf ), "CAL %d %s\r\n", ++sb->trId, who );
 			if( msn_sb_write( sb, buf, strlen( buf ) ) )
-			{
-				msn_sb_to_chat( sb );
-				return( 1 );
-			}
+				return msn_sb_to_chat( sb );
 		}
 		
@@ -314,8 +310,9 @@
 		md->msgq = g_slist_append( md->msgq, m );
 		
-		return( 1 );
-	}
-	
-	return( 0 );
+		/* FIXME: Can I try to return something here already? */
+		return NULL;
+	}
+	
+	return NULL;
 }
 
Index: protocols/msn/msn.h
===================================================================
--- protocols/msn/msn.h	(revision 0fd8559c4a6ad84ad0852e07c4ba2e50b2fdf0ad)
+++ protocols/msn/msn.h	(revision fa29d09342c79b886efacee4cfc3078be5f5a722)
@@ -169,8 +169,8 @@
 struct msn_switchboard *msn_sb_create( struct gaim_connection *gc, char *host, int port, char *key, int session );
 struct msn_switchboard *msn_sb_by_handle( struct gaim_connection *gc, char *handle );
-struct msn_switchboard *msn_sb_by_id( struct gaim_connection *gc, int id );
+struct msn_switchboard *msn_sb_by_chat( struct conversation *c );
 struct msn_switchboard *msn_sb_spare( struct gaim_connection *gc );
 int msn_sb_sendmessage( struct msn_switchboard *sb, char *text );
-void msn_sb_to_chat( struct msn_switchboard *sb );
+struct conversation *msn_sb_to_chat( struct msn_switchboard *sb );
 void msn_sb_destroy( struct msn_switchboard *sb );
 gboolean msn_sb_connected( gpointer data, gint source, b_input_condition cond );
Index: protocols/msn/sb.c
===================================================================
--- protocols/msn/sb.c	(revision 0fd8559c4a6ad84ad0852e07c4ba2e50b2fdf0ad)
+++ protocols/msn/sb.c	(revision fa29d09342c79b886efacee4cfc3078be5f5a722)
@@ -86,7 +86,7 @@
 }
 
-struct msn_switchboard *msn_sb_by_id( struct gaim_connection *gc, int id )
-{
-	struct msn_data *md = gc->proto_data;
+struct msn_switchboard *msn_sb_by_chat( struct conversation *c )
+{
+	struct msn_data *md = c->gc->proto_data;
 	struct msn_switchboard *sb;
 	GSList *l;
@@ -95,5 +95,5 @@
 	{
 		sb = l->data;
-		if( sb->chat && sb->chat->id == id )
+		if( sb->chat == c )
 			return( sb );
 	}
@@ -177,5 +177,5 @@
 }
 
-void msn_sb_to_chat( struct msn_switchboard *sb )
+struct conversation *msn_sb_to_chat( struct msn_switchboard *sb )
 {
 	struct gaim_connection *gc = sb->gc;
@@ -184,5 +184,5 @@
 	/* Create the groupchat structure. */
 	g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session );
-	sb->chat = serv_got_joined_chat( gc, ++msn_chat_id, buf );
+	sb->chat = serv_got_joined_chat( gc, buf );
 	
 	/* Populate the channel. */
@@ -196,4 +196,6 @@
 		sb->who = NULL;
 	}
+	
+	return sb->chat;
 }
 
@@ -230,5 +232,5 @@
 	if( sb->chat )
 	{
-		serv_got_chat_left( gc, sb->chat->id );
+		serv_got_chat_left( sb->chat );
 	}
 	
@@ -372,5 +374,5 @@
 			{
 				g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session );
-				sb->chat = serv_got_joined_chat( gc, ++msn_chat_id, buf );
+				sb->chat = serv_got_joined_chat( gc, buf );
 				
 				g_free( sb->who );
@@ -610,5 +612,5 @@
 			else if( sb->chat )
 			{
-				serv_got_chat_in( gc, sb->chat->id, cmd[1], 0, body, 0 );
+				serv_got_chat_in( sb->chat, cmd[1], 0, body, 0 );
 			}
 			else
@@ -669,5 +671,5 @@
 			else if( sb->chat )
 			{
-				serv_got_chat_in( gc, sb->chat->id, cmd[1], 0, buf, 0 );
+				serv_got_chat_in( sb->chat, cmd[1], 0, buf, 0 );
 			}
 			else
