Index: protocols/jabber/io.c
===================================================================
--- protocols/jabber/io.c	(revision 21782b3d081a3ac0d6c7c0e57736e4342b73779a)
+++ protocols/jabber/io.c	(revision 0da65d5fb37691ed4d31f7ab4058732f1440db6b)
@@ -26,7 +26,7 @@
 
 static gboolean jabber_write_callback( gpointer data, gint fd, b_input_condition cond );
-static gboolean jabber_write_queue( struct gaim_connection *gc );
-
-int jabber_write_packet( struct gaim_connection *gc, struct xt_node *node )
+static gboolean jabber_write_queue( struct im_connection *ic );
+
+int jabber_write_packet( struct im_connection *ic, struct xt_node *node )
 {
 	char *buf;
@@ -34,5 +34,5 @@
 	
 	buf = xt_to_string( node );
-	st = jabber_write( gc, buf, strlen( buf ) );
+	st = jabber_write( ic, buf, strlen( buf ) );
 	g_free( buf );
 	
@@ -40,7 +40,7 @@
 }
 
-int jabber_write( struct gaim_connection *gc, char *buf, int len )
-{
-	struct jabber_data *jd = gc->proto_data;
+int jabber_write( struct im_connection *ic, char *buf, int len )
+{
+	struct jabber_data *jd = ic->proto_data;
 	gboolean ret;
 	
@@ -54,6 +54,6 @@
 		   it via the event handler. If not, add the handler. (In
 		   most cases it probably won't be necessary.) */
-		if( ( ret = jabber_write_queue( gc ) ) && jd->tx_len > 0 )
-			jd->w_inpa = b_input_add( jd->fd, GAIM_INPUT_WRITE, jabber_write_callback, gc );
+		if( ( ret = jabber_write_queue( ic ) ) && jd->tx_len > 0 )
+			jd->w_inpa = b_input_add( jd->fd, GAIM_INPUT_WRITE, jabber_write_callback, ic );
 	}
 	else
@@ -85,5 +85,5 @@
 static gboolean jabber_write_callback( gpointer data, gint fd, b_input_condition cond )
 {
-	struct jabber_data *jd = ((struct gaim_connection *)data)->proto_data;
+	struct jabber_data *jd = ((struct im_connection *)data)->proto_data;
 	
 	return jd->fd != -1 &&
@@ -92,7 +92,7 @@
 }
 
-static gboolean jabber_write_queue( struct gaim_connection *gc )
-{
-	struct jabber_data *jd = gc->proto_data;
+static gboolean jabber_write_queue( struct im_connection *ic )
+{
+	struct jabber_data *jd = ic->proto_data;
 	int st;
 	
@@ -117,6 +117,6 @@
 		jd->fd = -1;
 		
-		hide_login_progress_error( gc, "Short write() to server" );
-		signoff( gc );
+		hide_login_progress_error( ic, "Short write() to server" );
+		signoff( ic );
 		return FALSE;
 	}
@@ -142,6 +142,6 @@
 static gboolean jabber_read_callback( gpointer data, gint fd, b_input_condition cond )
 {
-	struct gaim_connection *gc = data;
-	struct jabber_data *jd = gc->proto_data;
+	struct im_connection *ic = data;
+	struct jabber_data *jd = ic->proto_data;
 	char buf[512];
 	int st;
@@ -160,6 +160,6 @@
 		if( xt_feed( jd->xt, buf, st ) < 0 )
 		{
-			hide_login_progress_error( gc, "XML stream error" );
-			signoff( gc );
+			hide_login_progress_error( ic, "XML stream error" );
+			signoff( ic );
 			return FALSE;
 		}
@@ -176,5 +176,5 @@
 		{
 			jd->flags &= ~JFLAG_STREAM_RESTART;
-			jabber_start_stream( gc );
+			jabber_start_stream( ic );
 		}
 		
@@ -196,19 +196,19 @@
 				   this is an old server that can't do SASL
 				   authentication. */
-				if( !sasl_supported( gc ) )
+				if( !sasl_supported( ic ) )
 				{
 					/* If there's no version= tag, we suppose
 					   this server does NOT implement: XMPP 1.0,
 					   SASL and TLS. */
-					if( set_getbool( &gc->acc->set, "tls" ) )
+					if( set_getbool( &ic->acc->set, "tls" ) )
 					{
-						hide_login_progress( gc, "TLS is turned on for this "
+						hide_login_progress( ic, "TLS is turned on for this "
 						          "account, but is not supported by this server" );
-						signoff( gc );
+						signoff( ic );
 						return FALSE;
 					}
 					else
 					{
-						return jabber_init_iq_auth( gc );
+						return jabber_init_iq_auth( ic );
 					}
 				}
@@ -216,6 +216,6 @@
 			else
 			{
-				hide_login_progress( gc, "XML stream error" );
-				signoff( gc );
+				hide_login_progress( ic, "XML stream error" );
+				signoff( ic );
 				return FALSE;
 			}
@@ -227,6 +227,6 @@
 		jd->fd = -1;
 		
-		hide_login_progress_error( gc, "Error while reading from server" );
-		signoff( gc );
+		hide_login_progress_error( ic, "Error while reading from server" );
+		signoff( ic );
 		return FALSE;
 	}
@@ -238,22 +238,22 @@
 gboolean jabber_connected_plain( gpointer data, gint source, b_input_condition cond )
 {
-	struct gaim_connection *gc = data;
+	struct im_connection *ic = data;
 	
 	if( source == -1 )
 	{
-		hide_login_progress( gc, "Could not connect to server" );
-		signoff( gc );
+		hide_login_progress( ic, "Could not connect to server" );
+		signoff( ic );
 		return FALSE;
 	}
 	
-	set_login_progress( gc, 1, "Connected to server, logging in" );
-	
-	return jabber_start_stream( gc );
+	set_login_progress( ic, 1, "Connected to server, logging in" );
+	
+	return jabber_start_stream( ic );
 }
 
 gboolean jabber_connected_ssl( gpointer data, void *source, b_input_condition cond )
 {
-	struct gaim_connection *gc = data;
-	struct jabber_data *jd = gc->proto_data;
+	struct im_connection *ic = data;
+	struct jabber_data *jd = ic->proto_data;
 	
 	if( source == NULL )
@@ -263,12 +263,12 @@
 		jd->ssl = NULL;
 		
-		hide_login_progress( gc, "Could not connect to server" );
-		signoff( gc );
+		hide_login_progress( ic, "Could not connect to server" );
+		signoff( ic );
 		return FALSE;
 	}
 	
-	set_login_progress( gc, 1, "Connected to server, logging in" );
-	
-	return jabber_start_stream( gc );
+	set_login_progress( ic, 1, "Connected to server, logging in" );
+	
+	return jabber_start_stream( ic );
 }
 
@@ -281,10 +281,10 @@
 static xt_status jabber_pkt_features( struct xt_node *node, gpointer data )
 {
-	struct gaim_connection *gc = data;
-	struct jabber_data *jd = gc->proto_data;
+	struct im_connection *ic = data;
+	struct jabber_data *jd = ic->proto_data;
 	struct xt_node *c, *reply;
 	int trytls;
 	
-	trytls = g_strcasecmp( set_getstr( &gc->acc->set, "tls" ), "try" ) == 0;
+	trytls = g_strcasecmp( set_getstr( &ic->acc->set, "tls" ), "try" ) == 0;
 	c = xt_find_node( node->children, "starttls" );
 	if( c && !jd->ssl )
@@ -295,8 +295,8 @@
 		c = xt_find_node( c->children, "required" );
 		
-		if( c && ( !trytls && !set_getbool( &gc->acc->set, "tls" ) ) )
-		{
-			hide_login_progress( gc, "Server requires TLS connections, but TLS is turned off for this account" );
-			signoff( gc );
+		if( c && ( !trytls && !set_getbool( &ic->acc->set, "tls" ) ) )
+		{
+			hide_login_progress( ic, "Server requires TLS connections, but TLS is turned off for this account" );
+			signoff( ic );
 			
 			return XT_ABORT;
@@ -304,9 +304,9 @@
 		
 		/* Only run this if the tls setting is set to true or try: */
-		if( ( trytls || set_getbool( &gc->acc->set, "tls" ) ) )
+		if( ( trytls || set_getbool( &ic->acc->set, "tls" ) ) )
 		{
 			reply = xt_new_node( "starttls", NULL, NULL );
 			xt_add_attr( reply, "xmlns", XMLNS_TLS );
-			if( !jabber_write_packet( gc, reply ) )
+			if( !jabber_write_packet( ic, reply ) )
 			{
 				xt_free_node( reply );
@@ -325,8 +325,8 @@
 		   using SSL/TLS. */
 		
-		if( !trytls && set_getbool( &gc->acc->set, "tls" ) )
-		{
-			hide_login_progress( gc, "TLS is turned on for this account, but is not supported by this server" );
-			signoff( gc );
+		if( !trytls && set_getbool( &ic->acc->set, "tls" ) )
+		{
+			hide_login_progress( ic, "TLS is turned on for this account, but is not supported by this server" );
+			signoff( ic );
 			
 			return XT_ABORT;
@@ -346,7 +346,7 @@
 	   other way. jabber.com doesn't seem to do SASL while it pretends
 	   to be XMPP 1.0 compliant! */
-	else if( !( jd->flags & JFLAG_AUTHENTICATED ) && sasl_supported( gc ) )
-	{
-		if( !jabber_init_iq_auth( gc ) )
+	else if( !( jd->flags & JFLAG_AUTHENTICATED ) && sasl_supported( ic ) )
+	{
+		if( !jabber_init_iq_auth( ic ) )
 			return XT_ABORT;
 	}
@@ -354,10 +354,10 @@
 	if( ( c = xt_find_node( node->children, "bind" ) ) )
 	{
-		reply = xt_new_node( "bind", NULL, xt_new_node( "resource", set_getstr( &gc->acc->set, "resource" ), NULL ) );
+		reply = xt_new_node( "bind", NULL, xt_new_node( "resource", set_getstr( &ic->acc->set, "resource" ), NULL ) );
 		xt_add_attr( reply, "xmlns", XMLNS_BIND );
 		reply = jabber_make_packet( "iq", "set", NULL, reply );
-		jabber_cache_add( gc, reply, jabber_pkt_bind_sess );
-		
-		if( !jabber_write_packet( gc, reply ) )
+		jabber_cache_add( ic, reply, jabber_pkt_bind_sess );
+		
+		if( !jabber_write_packet( ic, reply ) )
 			return XT_ABORT;
 		
@@ -370,7 +370,7 @@
 		xt_add_attr( reply, "xmlns", XMLNS_SESSION );
 		reply = jabber_make_packet( "iq", "set", NULL, reply );
-		jabber_cache_add( gc, reply, jabber_pkt_bind_sess );
-		
-		if( !jabber_write_packet( gc, reply ) )
+		jabber_cache_add( ic, reply, jabber_pkt_bind_sess );
+		
+		if( !jabber_write_packet( ic, reply ) )
 			return XT_ABORT;
 		
@@ -383,5 +383,5 @@
 	if( jd->flags & JFLAG_AUTHENTICATED && ( jd->flags & ( JFLAG_WAIT_BIND | JFLAG_WAIT_SESSION ) ) == 0 )
 	{
-		if( !jabber_get_roster( gc ) )
+		if( !jabber_get_roster( ic ) )
 			return XT_ABORT;
 	}
@@ -392,6 +392,6 @@
 static xt_status jabber_pkt_proceed_tls( struct xt_node *node, gpointer data )
 {
-	struct gaim_connection *gc = data;
-	struct jabber_data *jd = gc->proto_data;
+	struct im_connection *ic = data;
+	struct jabber_data *jd = ic->proto_data;
 	char *xmlns;
 	
@@ -417,7 +417,7 @@
 	jd->w_inpa = jd->r_inpa = 0;
 	
-	set_login_progress( gc, 1, "Converting stream to TLS" );
-	
-	jd->ssl = ssl_starttls( jd->fd, jabber_connected_ssl, gc );
+	set_login_progress( ic, 1, "Converting stream to TLS" );
+	
+	jd->ssl = ssl_starttls( jd->fd, jabber_connected_ssl, ic );
 	
 	return XT_HANDLED;
@@ -426,5 +426,5 @@
 static xt_status jabber_pkt_stream_error( struct xt_node *node, gpointer data )
 {
-	struct gaim_connection *gc = data;
+	struct im_connection *ic = data;
 	struct xt_node *c;
 	char *s, *type = NULL, *text = NULL;
@@ -452,6 +452,6 @@
 	if( type == NULL )
 	{
-		hide_login_progress_error( gc, "Unknown stream error reported by server" );
-		signoff( gc );
+		hide_login_progress_error( ic, "Unknown stream error reported by server" );
+		signoff( ic );
 		return XT_ABORT;
 	}
@@ -462,15 +462,15 @@
 	if( strcmp( type, "conflict" ) == 0 )
 	{
-		hide_login_progress( gc, "Account and resource used from a different location" );
-		gc->wants_to_die = TRUE;
+		hide_login_progress( ic, "Account and resource used from a different location" );
+		ic->wants_to_die = TRUE;
 	}
 	else
 	{
 		s = g_strdup_printf( "Stream error: %s%s%s", type, text ? ": " : "", text ? text : "" );
-		hide_login_progress_error( gc, s );
+		hide_login_progress_error( ic, s );
 		g_free( s );
 	}
 	
-	signoff( gc );
+	signoff( ic );
 	
 	return XT_ABORT;
@@ -500,7 +500,7 @@
 };
 
-gboolean jabber_start_stream( struct gaim_connection *gc )
-{
-	struct jabber_data *jd = gc->proto_data;
+gboolean jabber_start_stream( struct im_connection *ic )
+{
+	struct jabber_data *jd = ic->proto_data;
 	int st;
 	char *greet;
@@ -509,9 +509,9 @@
 	   from the server too. */
 	xt_free( jd->xt );	/* In case we're RE-starting. */
-	jd->xt = xt_new( gc );
+	jd->xt = xt_new( ic );
 	jd->xt->handlers = (struct xt_handler_entry*) jabber_handlers;
 	
 	if( jd->r_inpa <= 0 )
-		jd->r_inpa = b_input_add( jd->fd, GAIM_INPUT_READ, jabber_read_callback, gc );
+		jd->r_inpa = b_input_add( jd->fd, GAIM_INPUT_READ, jabber_read_callback, ic );
 	
 	greet = g_strdup_printf( "<?xml version='1.0' ?>"
@@ -519,5 +519,5 @@
 	                          "xmlns:stream=\"http://etherx.jabber.org/streams\" version=\"1.0\">", jd->server );
 	
-	st = jabber_write( gc, greet, strlen( greet ) );
+	st = jabber_write( ic, greet, strlen( greet ) );
 	
 	g_free( greet );
@@ -526,7 +526,7 @@
 }
 
-void jabber_end_stream( struct gaim_connection *gc )
-{
-	struct jabber_data *jd = gc->proto_data;
+void jabber_end_stream( struct im_connection *ic )
+{
+	struct jabber_data *jd = ic->proto_data;
 	
 	/* Let's only do this if the queue is currently empty, otherwise it'd
@@ -538,13 +538,13 @@
 		int st = 1;
 		
-		if( gc->flags & OPT_LOGGED_IN )
+		if( ic->flags & OPT_LOGGED_IN )
 		{
 			node = jabber_make_packet( "presence", "unavailable", NULL, NULL );
-			st = jabber_write_packet( gc, node );
+			st = jabber_write_packet( ic, node );
 			xt_free_node( node );
 		}
 		
 		if( st )
-			jabber_write( gc, eos, strlen( eos ) );
-	}
-}
+			jabber_write( ic, eos, strlen( eos ) );
+	}
+}
Index: protocols/jabber/iq.c
===================================================================
--- protocols/jabber/iq.c	(revision 21782b3d081a3ac0d6c7c0e57736e4342b73779a)
+++ protocols/jabber/iq.c	(revision 0da65d5fb37691ed4d31f7ab4058732f1440db6b)
@@ -24,11 +24,11 @@
 #include "jabber.h"
 
-static xt_status jabber_parse_roster( struct gaim_connection *gc, struct xt_node *node, struct xt_node *orig );
-static xt_status jabber_iq_display_vcard( struct gaim_connection *gc, struct xt_node *node, struct xt_node *orig );
+static xt_status jabber_parse_roster( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
+static xt_status jabber_iq_display_vcard( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
 
 xt_status jabber_pkt_iq( struct xt_node *node, gpointer data )
 {
-	struct gaim_connection *gc = data;
-	struct jabber_data *jd = gc->proto_data;
+	struct im_connection *ic = data;
+	struct jabber_data *jd = ic->proto_data;
 	struct xt_node *c, *reply = NULL;
 	char *type, *s;
@@ -39,6 +39,6 @@
 	if( !type )
 	{
-		hide_login_progress_error( gc, "Received IQ packet without type." );
-		signoff( gc );
+		hide_login_progress_error( ic, "Received IQ packet without type." );
+		signoff( ic );
 		return XT_ABORT;
 	}
@@ -60,7 +60,7 @@
 		
 		if( entry == NULL )
-			serv_got_crap( gc, "WARNING: Received IQ-%s packet with unknown/expired ID %s!", type, s );
+			serv_got_crap( ic, "WARNING: Received IQ-%s packet with unknown/expired ID %s!", type, s );
 		else if( entry->func )
-			return entry->func( gc, node, entry->node );
+			return entry->func( ic, node, entry->node );
 	}
 	else if( strcmp( type, "get" ) == 0 )
@@ -69,5 +69,5 @@
 		    !( s = xt_find_attr( c, "xmlns" ) ) )
 		{
-			serv_got_crap( gc, "WARNING: Received incomplete IQ-%s packet", type );
+			serv_got_crap( ic, "WARNING: Received incomplete IQ-%s packet", type );
 			return XT_HANDLED;
 		}
@@ -132,5 +132,5 @@
 		    !( s = xt_find_attr( c, "xmlns" ) ) )
 		{
-			serv_got_crap( gc, "WARNING: Received incomplete IQ-%s packet", type );
+			serv_got_crap( ic, "WARNING: Received incomplete IQ-%s packet", type );
 			return XT_HANDLED;
 		}
@@ -141,11 +141,11 @@
 		if( strcmp( s, XMLNS_ROSTER ) == 0 )
 		{
-			int bare_len = strlen( gc->acc->user );
+			int bare_len = strlen( ic->acc->user );
 			
 			if( ( s = xt_find_attr( node, "from" ) ) == NULL ||
-			    ( strncmp( s, gc->acc->user, bare_len ) == 0 &&
+			    ( strncmp( s, ic->acc->user, bare_len ) == 0 &&
 			      ( s[bare_len] == 0 || s[bare_len] == '/' ) ) )
 			{
-				jabber_parse_roster( gc, node, NULL );
+				jabber_parse_roster( ic, node, NULL );
 				
 				/* Should we generate a reply here? Don't think it's
@@ -154,5 +154,5 @@
 			else
 			{
-				serv_got_crap( gc, "WARNING: %s tried to fake a roster push!", s ? s : "(unknown)" );
+				serv_got_crap( ic, "WARNING: %s tried to fake a roster push!", s ? s : "(unknown)" );
 				
 				xt_free_node( reply );
@@ -182,5 +182,5 @@
 		}
 		
-		st = jabber_write_packet( gc, reply );
+		st = jabber_write_packet( ic, reply );
 		xt_free_node( reply );
 		if( !st )
@@ -191,10 +191,10 @@
 }
 
-static xt_status jabber_do_iq_auth( struct gaim_connection *gc, struct xt_node *node, struct xt_node *orig );
-static xt_status jabber_finish_iq_auth( struct gaim_connection *gc, struct xt_node *node, struct xt_node *orig );
-
-int jabber_init_iq_auth( struct gaim_connection *gc )
-{
-	struct jabber_data *jd = gc->proto_data;
+static xt_status jabber_do_iq_auth( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
+static xt_status jabber_finish_iq_auth( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
+
+int jabber_init_iq_auth( struct im_connection *ic )
+{
+	struct jabber_data *jd = ic->proto_data;
 	struct xt_node *node;
 	int st;
@@ -204,13 +204,13 @@
 	node = jabber_make_packet( "iq", "get", NULL, node );
 	
-	jabber_cache_add( gc, node, jabber_do_iq_auth );
-	st = jabber_write_packet( gc, node );
+	jabber_cache_add( ic, node, jabber_do_iq_auth );
+	st = jabber_write_packet( ic, node );
 	
 	return st;
 }
 
-static xt_status jabber_do_iq_auth( struct gaim_connection *gc, struct xt_node *node, struct xt_node *orig )
-{
-	struct jabber_data *jd = gc->proto_data;
+static xt_status jabber_do_iq_auth( struct im_connection *ic, struct xt_node *node, struct xt_node *orig )
+{
+	struct jabber_data *jd = ic->proto_data;
 	struct xt_node *reply, *query;
 	xt_status st;
@@ -219,6 +219,6 @@
 	if( !( query = xt_find_node( node->children, "query" ) ) )
 	{
-		serv_got_crap( gc, "WARNING: Received incomplete IQ packet while authenticating" );
-		signoff( gc );
+		serv_got_crap( ic, "WARNING: Received incomplete IQ packet while authenticating" );
+		signoff( ic );
 		return XT_HANDLED;
 	}
@@ -228,5 +228,5 @@
 	xt_add_attr( reply, "xmlns", XMLNS_AUTH );
 	xt_add_child( reply, xt_new_node( "username", jd->username, NULL ) );
-	xt_add_child( reply, xt_new_node( "resource", set_getstr( &gc->acc->set, "resource" ), NULL ) );
+	xt_add_child( reply, xt_new_node( "resource", set_getstr( &ic->acc->set, "resource" ), NULL ) );
 	
 	if( xt_find_node( query->children, "digest" ) && ( s = xt_find_attr( jd->xt->root, "id" ) ) )
@@ -241,5 +241,5 @@
 		shaInit( &sha );
 		shaUpdate( &sha, (unsigned char*) s, strlen( s ) );
-		shaUpdate( &sha, (unsigned char*) gc->acc->pass, strlen( gc->acc->pass ) );
+		shaUpdate( &sha, (unsigned char*) ic->acc->pass, strlen( ic->acc->pass ) );
 		shaFinal( &sha, hash );
 		
@@ -252,5 +252,5 @@
 	{
 		/* We'll have to stick with plaintext. Let's hope we're using SSL/TLS... */
-		xt_add_child( reply, xt_new_node( "password", gc->acc->pass, NULL ) );
+		xt_add_child( reply, xt_new_node( "password", ic->acc->pass, NULL ) );
 	}
 	else
@@ -258,25 +258,25 @@
 		xt_free_node( reply );
 		
-		hide_login_progress( gc, "Can't find suitable authentication method" );
-		signoff( gc );
+		hide_login_progress( ic, "Can't find suitable authentication method" );
+		signoff( ic );
 		return XT_ABORT;
 	}
 	
 	reply = jabber_make_packet( "iq", "set", NULL, reply );
-	jabber_cache_add( gc, reply, jabber_finish_iq_auth );
-	st = jabber_write_packet( gc, reply );
+	jabber_cache_add( ic, reply, jabber_finish_iq_auth );
+	st = jabber_write_packet( ic, reply );
 	
 	return st ? XT_HANDLED : XT_ABORT;
 }
 
-static xt_status jabber_finish_iq_auth( struct gaim_connection *gc, struct xt_node *node, struct xt_node *orig )
-{
-	struct jabber_data *jd = gc->proto_data;
+static xt_status jabber_finish_iq_auth( struct im_connection *ic, struct xt_node *node, struct xt_node *orig )
+{
+	struct jabber_data *jd = ic->proto_data;
 	char *type;
 	
 	if( !( type = xt_find_attr( node, "type" ) ) )
 	{
-		serv_got_crap( gc, "WARNING: Received incomplete IQ packet while authenticating" );
-		signoff( gc );
+		serv_got_crap( ic, "WARNING: Received incomplete IQ packet while authenticating" );
+		signoff( ic );
 		return XT_HANDLED;
 	}
@@ -284,6 +284,6 @@
 	if( strcmp( type, "error" ) == 0 )
 	{
-		hide_login_progress( gc, "Authentication failure" );
-		signoff( gc );
+		hide_login_progress( ic, "Authentication failure" );
+		signoff( ic );
 		return XT_ABORT;
 	}
@@ -293,5 +293,5 @@
 		   old (non-SASL) way. */
 		jd->flags |= JFLAG_AUTHENTICATED;
-		if( !jabber_get_roster( gc ) )
+		if( !jabber_get_roster( ic ) )
 			return XT_ABORT;
 	}
@@ -300,7 +300,7 @@
 }
 
-xt_status jabber_pkt_bind_sess( struct gaim_connection *gc, struct xt_node *node, struct xt_node *orig )
-{
-	struct jabber_data *jd = gc->proto_data;
+xt_status jabber_pkt_bind_sess( struct im_connection *ic, struct xt_node *node, struct xt_node *orig )
+{
+	struct jabber_data *jd = ic->proto_data;
 	struct xt_node *c;
 	char *s;
@@ -310,6 +310,6 @@
 		c = xt_find_node( c->children, "jid" );
 		if( c && c->text_len && ( s = strchr( c->text, '/' ) ) &&
-		    strcmp( s + 1, set_getstr( &gc->acc->set, "resource" ) ) != 0 )
-			serv_got_crap( gc, "Server changed session resource string to `%s'", s + 1 );
+		    strcmp( s + 1, set_getstr( &ic->acc->set, "resource" ) ) != 0 )
+			serv_got_crap( ic, "Server changed session resource string to `%s'", s + 1 );
 		
 		jd->flags &= ~JFLAG_WAIT_BIND;
@@ -322,5 +322,5 @@
 	if( ( jd->flags & ( JFLAG_WAIT_BIND | JFLAG_WAIT_SESSION ) ) == 0 )
 	{
-		if( !jabber_get_roster( gc ) )
+		if( !jabber_get_roster( ic ) )
 			return XT_ABORT;
 	}
@@ -329,10 +329,10 @@
 }
 
-int jabber_get_roster( struct gaim_connection *gc )
+int jabber_get_roster( struct im_connection *ic )
 {
 	struct xt_node *node;
 	int st;
 	
-	set_login_progress( gc, 1, "Authenticated, requesting buddy list" );
+	set_login_progress( ic, 1, "Authenticated, requesting buddy list" );
 	
 	node = xt_new_node( "query", NULL, NULL );
@@ -340,11 +340,11 @@
 	node = jabber_make_packet( "iq", "get", NULL, node );
 	
-	jabber_cache_add( gc, node, jabber_parse_roster );
-	st = jabber_write_packet( gc, node );
+	jabber_cache_add( ic, node, jabber_parse_roster );
+	st = jabber_write_packet( ic, node );
 	
 	return st;
 }
 
-static xt_status jabber_parse_roster( struct gaim_connection *gc, struct xt_node *node, struct xt_node *orig )
+static xt_status jabber_parse_roster( struct im_connection *ic, struct xt_node *node, struct xt_node *orig )
 {
 	struct xt_node *query, *c;
@@ -353,5 +353,5 @@
 	if( !( query = xt_find_node( node->children, "query" ) ) )
 	{
-		serv_got_crap( gc, "WARNING: Received NULL roster packet" );
+		serv_got_crap( ic, "WARNING: Received NULL roster packet" );
 		return XT_HANDLED;
 	}
@@ -371,5 +371,5 @@
 		{
 			if( ( strcmp( sub, "both" ) == 0 || strcmp( sub, "to" ) == 0 ) )
-				add_buddy( gc, NULL, jid, name );
+				add_buddy( ic, NULL, jid, name );
 		}
 		else
@@ -378,8 +378,8 @@
 			if( ( strcmp( sub, "both" ) == 0 || strcmp( sub, "to" ) == 0 ) )
 			{
-				if( find_buddy( gc, jid ) == NULL )
-					add_buddy( gc, NULL, jid, name );
+				if( find_buddy( ic, jid ) == NULL )
+					add_buddy( ic, NULL, jid, name );
 				else if( name )
-					serv_buddy_rename( gc, jid, name );
+					serv_buddy_rename( ic, jid, name );
 			}
 			else if( strcmp( sub, "remove" ) == 0 )
@@ -387,6 +387,6 @@
 				/* Don't have any API call for this yet! So let's
 				   just try to handle this as well as we can. */
-				jabber_buddy_remove_bare( gc, jid );
-				serv_got_update( gc, jid, 0, 0, 0, 0, 0, 0 );
+				jabber_buddy_remove_bare( ic, jid );
+				serv_got_update( ic, jid, 0, 0, 0, 0, 0, 0 );
 				/* FIXME! */
 			}
@@ -397,10 +397,10 @@
 	
 	if( initial )
-		account_online( gc );
+		account_online( ic );
 	
 	return XT_HANDLED;
 }
 
-int jabber_get_vcard( struct gaim_connection *gc, char *bare_jid )
+int jabber_get_vcard( struct im_connection *ic, char *bare_jid )
 {
 	struct xt_node *node;
@@ -413,11 +413,11 @@
 	node = jabber_make_packet( "iq", "get", bare_jid, node );
 	
-	jabber_cache_add( gc, node, jabber_iq_display_vcard );
-	return jabber_write_packet( gc, node );
-}
-
-static xt_status jabber_iq_display_vcard( struct gaim_connection *gc, struct xt_node *node, struct xt_node *orig )
-{
-	struct xt_node *vc, *c, *sc; /* subchild, gc is already in use ;-) */
+	jabber_cache_add( ic, node, jabber_iq_display_vcard );
+	return jabber_write_packet( ic, node );
+}
+
+static xt_status jabber_iq_display_vcard( struct im_connection *ic, struct xt_node *node, struct xt_node *orig )
+{
+	struct xt_node *vc, *c, *sc; /* subchild, ic is already in use ;-) */
 	GString *reply;
 	char *s;
@@ -428,5 +428,5 @@
 	{
 		s = xt_find_attr( orig, "to" ); /* If this returns NULL something's wrong.. */
-		serv_got_crap( gc, "Could not retrieve vCard of %s", s ? s : "(NULL)" );
+		serv_got_crap( ic, "Could not retrieve vCard of %s", s ? s : "(NULL)" );
 		return XT_HANDLED;
 	}
@@ -536,5 +536,5 @@
 	/* *sigh* */
 	
-	serv_got_crap( gc, reply->str );
+	serv_got_crap( ic, reply->str );
 	g_string_free( reply, TRUE );
 	
@@ -542,5 +542,5 @@
 }
 
-int jabber_add_to_roster( struct gaim_connection *gc, char *handle, char *name )
+int jabber_add_to_roster( struct im_connection *ic, char *handle, char *name )
 {
 	struct xt_node *node;
@@ -558,5 +558,5 @@
 	node = jabber_make_packet( "iq", "set", NULL, node );
 	
-	st = jabber_write_packet( gc, node );
+	st = jabber_write_packet( ic, node );
 	
 	xt_free_node( node );
@@ -564,5 +564,5 @@
 }
 
-int jabber_remove_from_roster( struct gaim_connection *gc, char *handle )
+int jabber_remove_from_roster( struct im_connection *ic, char *handle )
 {
 	struct xt_node *node;
@@ -579,5 +579,5 @@
 	node = jabber_make_packet( "iq", "set", NULL, node );
 	
-	st = jabber_write_packet( gc, node );
+	st = jabber_write_packet( ic, node );
 	
 	xt_free_node( node );
Index: protocols/jabber/jabber.c
===================================================================
--- protocols/jabber/jabber.c	(revision 21782b3d081a3ac0d6c7c0e57736e4342b73779a)
+++ protocols/jabber/jabber.c	(revision 0da65d5fb37691ed4d31f7ab4058732f1440db6b)
@@ -33,5 +33,5 @@
 #include "jabber.h"
 
-static void jabber_acc_init( account_t *acc )
+static void jabber_init( account_t *acc )
 {
 	set_t *s;
@@ -59,11 +59,11 @@
 static void jabber_login( account_t *acc )
 {
-	struct gaim_connection *gc = new_gaim_conn( acc );
+	struct im_connection *ic = new_gaim_conn( acc );
 	struct jabber_data *jd = g_new0( struct jabber_data, 1 );
 	struct ns_srv_reply *srv = NULL;
 	char *connect_to, *s;
 	
-	jd->gc = gc;
-	gc->proto_data = jd;
+	jd->ic = ic;
+	ic->proto_data = jd;
 	
 	jd->username = g_strdup( acc->user );
@@ -72,6 +72,6 @@
 	if( jd->server == NULL )
 	{
-		hide_login_progress( gc, "Incomplete account name (format it like <username@jabberserver.name>)" );
-		signoff( gc );
+		hide_login_progress( ic, "Incomplete account name (format it like <username@jabberserver.name>)" );
+		signoff( ic );
 		return;
 	}
@@ -159,12 +159,12 @@
 		connect_to = jd->server;
 	
-	set_login_progress( gc, 0, "Connecting" );
+	set_login_progress( ic, 0, "Connecting" );
 	
 	if( set_getint( &acc->set, "port" ) < JABBER_PORT_MIN ||
 	    set_getint( &acc->set, "port" ) > JABBER_PORT_MAX )
 	{
-		serv_got_crap( gc, "Incorrect port number, must be in the %d-%d range",
+		serv_got_crap( ic, "Incorrect port number, must be in the %d-%d range",
 		               JABBER_PORT_MIN, JABBER_PORT_MAX );
-		signoff( gc );
+		signoff( ic );
 		return;
 	}
@@ -175,10 +175,10 @@
 	if( set_getbool( &acc->set, "ssl" ) )
 	{
-		jd->ssl = ssl_connect( connect_to, set_getint( &acc->set, "port" ), jabber_connected_ssl, gc );
+		jd->ssl = ssl_connect( connect_to, set_getint( &acc->set, "port" ), jabber_connected_ssl, ic );
 		jd->fd = jd->ssl ? ssl_getfd( jd->ssl ) : -1;
 	}
 	else
 	{
-		jd->fd = proxy_connect( connect_to, srv ? srv->port : set_getint( &acc->set, "port" ), jabber_connected_plain, gc );
+		jd->fd = proxy_connect( connect_to, srv ? srv->port : set_getint( &acc->set, "port" ), jabber_connected_plain, ic );
 	}
 	g_free( srv );
@@ -186,14 +186,14 @@
 	if( jd->fd == -1 )
 	{
-		hide_login_progress( gc, "Could not connect to server" );
-		signoff( gc );
-	}
-}
-
-static void jabber_close( struct gaim_connection *gc )
-{
-	struct jabber_data *jd = gc->proto_data;
-	
-	jabber_end_stream( gc );
+		hide_login_progress( ic, "Could not connect to server" );
+		signoff( ic );
+	}
+}
+
+static void jabber_logout( struct im_connection *ic )
+{
+	struct jabber_data *jd = ic->proto_data;
+	
+	jabber_end_stream( ic );
 	
 	if( jd->r_inpa >= 0 )
@@ -219,12 +219,12 @@
 }
 
-static int jabber_send_im( struct gaim_connection *gc, char *who, char *message, int len, int away )
-{
-	struct jabber_data *jd = gc->proto_data;
+static int jabber_send_im( struct im_connection *ic, char *who, char *message, int flags )
+{
+	struct jabber_data *jd = ic->proto_data;
 	struct jabber_buddy *bud;
 	struct xt_node *node;
 	int st;
 	
-	bud = jabber_buddy_by_jid( gc, who, 0 );
+	bud = jabber_buddy_by_jid( ic, who, 0 );
 	
 	node = xt_new_node( "body", message, NULL );
@@ -251,5 +251,5 @@
 	}
 	
-	st = jabber_write_packet( gc, node );
+	st = jabber_write_packet( ic, node );
 	xt_free_node( node );
 	
@@ -257,5 +257,5 @@
 }
 
-static GList *jabber_away_states( struct gaim_connection *gc )
+static GList *jabber_away_states( struct im_connection *ic )
 {
 	static GList *l = NULL;
@@ -269,11 +269,11 @@
 }
 
-static void jabber_get_info( struct gaim_connection *gc, char *who )
-{
-	struct jabber_data *jd = gc->proto_data;
+static void jabber_get_info( struct im_connection *ic, char *who )
+{
+	struct jabber_data *jd = ic->proto_data;
 	struct jabber_buddy *bud;
 	
 	if( strchr( who, '/' ) )
-		bud = jabber_buddy_by_jid( gc, who, 0 );
+		bud = jabber_buddy_by_jid( ic, who, 0 );
 	else
 	{
@@ -285,5 +285,5 @@
 	while( bud )
 	{
-		serv_got_crap( gc, "Buddy %s (%d) information:\nAway state: %s\nAway message: %s",
+		serv_got_crap( ic, "Buddy %s (%d) information:\nAway state: %s\nAway message: %s",
 		                   bud->full_jid, bud->priority,
 		                   bud->away_state ? bud->away_state->full_name : "(none)",
@@ -292,10 +292,10 @@
 	}
 	
-	jabber_get_vcard( gc, bud ? bud->full_jid : who );
-}
-
-static void jabber_set_away( struct gaim_connection *gc, char *state_txt, char *message )
-{
-	struct jabber_data *jd = gc->proto_data;
+	jabber_get_vcard( ic, bud ? bud->full_jid : who );
+}
+
+static void jabber_set_away( struct im_connection *ic, char *state_txt, char *message )
+{
+	struct jabber_data *jd = ic->proto_data;
 	struct jabber_away_state *state;
 	
@@ -306,35 +306,35 @@
 	jd->away_message = ( message && *message ) ? g_strdup( message ) : NULL;
 	
-	presence_send_update( gc );
-}
-
-static void jabber_add_buddy( struct gaim_connection *gc, char *who )
-{
-	if( jabber_add_to_roster( gc, who, NULL ) )
-		presence_send_request( gc, who, "subscribe" );
-}
-
-static void jabber_remove_buddy( struct gaim_connection *gc, char *who, char *group )
+	presence_send_update( ic );
+}
+
+static void jabber_add_buddy( struct im_connection *ic, char *who, char *group )
+{
+	if( jabber_add_to_roster( ic, who, NULL ) )
+		presence_send_request( ic, who, "subscribe" );
+}
+
+static void jabber_remove_buddy( struct im_connection *ic, char *who, char *group )
 {
 	/* We should always do this part. Clean up our administration a little bit. */
-	jabber_buddy_remove_bare( gc, who );
-	
-	if( jabber_remove_from_roster( gc, who ) )
-		presence_send_request( gc, who, "unsubscribe" );
-}
-
-static void jabber_keepalive( struct gaim_connection *gc )
+	jabber_buddy_remove_bare( ic, who );
+	
+	if( jabber_remove_from_roster( ic, who ) )
+		presence_send_request( ic, who, "unsubscribe" );
+}
+
+static void jabber_keepalive( struct im_connection *ic )
 {
 	/* Just any whitespace character is enough as a keepalive for XMPP sessions. */
-	jabber_write( gc, "\n", 1 );
+	jabber_write( ic, "\n", 1 );
 	
 	/* This runs the garbage collection every minute, which means every packet
 	   is in the cache for about a minute (which should be enough AFAIK). */
-	jabber_cache_clean( gc );
-}
-
-static int jabber_send_typing( struct gaim_connection *gc, char *who, int typing )
-{
-	struct jabber_data *jd = gc->proto_data;
+	jabber_cache_clean( ic );
+}
+
+static int jabber_send_typing( struct im_connection *ic, char *who, int typing )
+{
+	struct jabber_data *jd = ic->proto_data;
 	struct jabber_buddy *bud;
 	
@@ -342,5 +342,5 @@
 	jd->flags |= JFLAG_WANT_TYPING;
 	
-	if( ( bud = jabber_buddy_by_jid( gc, who, 0 ) ) == NULL )
+	if( ( bud = jabber_buddy_by_jid( ic, who, 0 ) ) == NULL )
 	{
 		/* Sending typing notifications to unknown buddies is
@@ -369,5 +369,5 @@
 		node = jabber_make_packet( "message", "chat", bud->full_jid, node );
 		
-		st = jabber_write_packet( gc, node );
+		st = jabber_write_packet( ic, node );
 		xt_free_node( node );
 		
@@ -378,5 +378,5 @@
 }
 
-void jabber_init()
+void jabber_initmodule()
 {
 	struct prpl *ret = g_new0( struct prpl, 1 );
@@ -384,6 +384,6 @@
 	ret->name = "jabber";
 	ret->login = jabber_login;
-	ret->acc_init = jabber_acc_init;
-	ret->close = jabber_close;
+	ret->init = jabber_init;
+	ret->logout = jabber_logout;
 	ret->send_im = jabber_send_im;
 	ret->away_states = jabber_away_states;
Index: protocols/jabber/jabber.h
===================================================================
--- protocols/jabber/jabber.h	(revision 21782b3d081a3ac0d6c7c0e57736e4342b73779a)
+++ protocols/jabber/jabber.h	(revision 0da65d5fb37691ed4d31f7ab4058732f1440db6b)
@@ -58,5 +58,5 @@
 struct jabber_data
 {
-	struct gaim_connection *gc;
+	struct im_connection *ic;
 	
 	int fd;
@@ -87,5 +87,5 @@
 };
 
-typedef xt_status (*jabber_cache_event) ( struct gaim_connection *gc, struct xt_node *node, struct xt_node *orig );
+typedef xt_status (*jabber_cache_event) ( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
 
 struct jabber_cache_entry
@@ -137,10 +137,10 @@
 /* iq.c */
 xt_status jabber_pkt_iq( struct xt_node *node, gpointer data );
-int jabber_init_iq_auth( struct gaim_connection *gc );
-xt_status jabber_pkt_bind_sess( struct gaim_connection *gc, struct xt_node *node, struct xt_node *orig );
-int jabber_get_roster( struct gaim_connection *gc );
-int jabber_get_vcard( struct gaim_connection *gc, char *bare_jid );
-int jabber_add_to_roster( struct gaim_connection *gc, char *handle, char *name );
-int jabber_remove_from_roster( struct gaim_connection *gc, char *handle );
+int jabber_init_iq_auth( struct im_connection *ic );
+xt_status jabber_pkt_bind_sess( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
+int jabber_get_roster( struct im_connection *ic );
+int jabber_get_vcard( struct im_connection *ic, char *bare_jid );
+int jabber_add_to_roster( struct im_connection *ic, char *handle, char *name );
+int jabber_remove_from_roster( struct im_connection *ic, char *handle );
 
 /* message.c */
@@ -149,6 +149,6 @@
 /* presence.c */
 xt_status jabber_pkt_presence( struct xt_node *node, gpointer data );
-int presence_send_update( struct gaim_connection *gc );
-int presence_send_request( struct gaim_connection *gc, char *handle, char *request );
+int presence_send_update( struct im_connection *ic );
+int presence_send_request( struct im_connection *ic, char *handle, char *request );
 
 /* jabber_util.c */
@@ -157,11 +157,11 @@
 struct xt_node *jabber_make_packet( char *name, char *type, char *to, struct xt_node *children );
 struct xt_node *jabber_make_error_packet( struct xt_node *orig, char *err_cond, char *err_type );
-void jabber_cache_add( struct gaim_connection *gc, struct xt_node *node, jabber_cache_event func );
-struct xt_node *jabber_cache_get( struct gaim_connection *gc, char *id );
+void jabber_cache_add( struct im_connection *ic, struct xt_node *node, jabber_cache_event func );
+struct xt_node *jabber_cache_get( struct im_connection *ic, char *id );
 void jabber_cache_entry_free( gpointer entry );
-void jabber_cache_clean( struct gaim_connection *gc );
+void jabber_cache_clean( struct im_connection *ic );
 const struct jabber_away_state *jabber_away_state_by_code( char *code );
 const struct jabber_away_state *jabber_away_state_by_name( char *name );
-void jabber_buddy_ask( struct gaim_connection *gc, char *handle );
+void jabber_buddy_ask( struct im_connection *ic, char *handle );
 char *jabber_normalize( char *orig );
 
@@ -172,18 +172,18 @@
 } get_buddy_flags_t;
 
-struct jabber_buddy *jabber_buddy_add( struct gaim_connection *gc, char *full_jid );
-struct jabber_buddy *jabber_buddy_by_jid( struct gaim_connection *gc, char *jid, get_buddy_flags_t flags );
-int jabber_buddy_remove( struct gaim_connection *gc, char *full_jid );
-int jabber_buddy_remove_bare( struct gaim_connection *gc, char *bare_jid );
+struct jabber_buddy *jabber_buddy_add( struct im_connection *ic, char *full_jid );
+struct jabber_buddy *jabber_buddy_by_jid( struct im_connection *ic, char *jid, get_buddy_flags_t flags );
+int jabber_buddy_remove( struct im_connection *ic, char *full_jid );
+int jabber_buddy_remove_bare( struct im_connection *ic, char *bare_jid );
 
 extern const struct jabber_away_state jabber_away_state_list[];
 
 /* io.c */
-int jabber_write_packet( struct gaim_connection *gc, struct xt_node *node );
-int jabber_write( struct gaim_connection *gc, char *buf, int len );
+int jabber_write_packet( struct im_connection *ic, struct xt_node *node );
+int jabber_write( struct im_connection *ic, char *buf, int len );
 gboolean jabber_connected_plain( gpointer data, gint source, b_input_condition cond );
 gboolean jabber_connected_ssl( gpointer data, void *source, b_input_condition cond );
-gboolean jabber_start_stream( struct gaim_connection *gc );
-void jabber_end_stream( struct gaim_connection *gc );
+gboolean jabber_start_stream( struct im_connection *ic );
+void jabber_end_stream( struct im_connection *ic );
 
 /* sasl.c */
@@ -191,5 +191,5 @@
 xt_status sasl_pkt_challenge( struct xt_node *node, gpointer data );
 xt_status sasl_pkt_result( struct xt_node *node, gpointer data );
-gboolean sasl_supported( struct gaim_connection *gc );
+gboolean sasl_supported( struct im_connection *ic );
 
 #endif
Index: protocols/jabber/jabber_util.c
===================================================================
--- protocols/jabber/jabber_util.c	(revision 21782b3d081a3ac0d6c7c0e57736e4342b73779a)
+++ protocols/jabber/jabber_util.c	(revision 0da65d5fb37691ed4d31f7ab4058732f1440db6b)
@@ -42,5 +42,5 @@
 	/* Only run this stuff if the account is online ATM,
 	   and if the setting seems to be acceptable. */
-	if( acc->gc )
+	if( acc->ic )
 	{
 		/* Although set_eval functions usually are very nice and
@@ -58,5 +58,5 @@
 		/* (Yes, sorry, I prefer the hack. :-P) */
 		
-		presence_send_update( acc->gc );
+		presence_send_update( acc->ic );
 	}
 	
@@ -130,7 +130,7 @@
    them when you receive the response. Use this BEFORE sending the packet so
    it'll get a new id= tag, and do NOT free() the packet after writing it! */
-void jabber_cache_add( struct gaim_connection *gc, struct xt_node *node, jabber_cache_event func )
-{
-	struct jabber_data *jd = gc->proto_data;
+void jabber_cache_add( struct im_connection *ic, struct xt_node *node, jabber_cache_event func )
+{
+	struct jabber_data *jd = ic->proto_data;
 	char *id = g_strdup_printf( "%s%05x", JABBER_CACHED_ID, ( next_id++ ) & 0xfffff );
 	struct jabber_cache_entry *entry = g_new0( struct jabber_cache_entry, 1 );
@@ -159,7 +159,7 @@
    node should be available in the cache for at least a minute (assuming the
    function is indeed called every minute). */
-void jabber_cache_clean( struct gaim_connection *gc )
-{
-	struct jabber_data *jd = gc->proto_data;
+void jabber_cache_clean( struct im_connection *ic )
+{
+	struct jabber_data *jd = ic->proto_data;
 	
 	g_hash_table_foreach_remove( jd->node_cache, jabber_cache_clean_entry, NULL );
@@ -214,5 +214,5 @@
 struct jabber_buddy_ask_data
 {
-	struct gaim_connection *gc;
+	struct im_connection *ic;
 	char *handle;
 	char *realname;
@@ -221,8 +221,8 @@
 static void jabber_buddy_ask_yes( gpointer w, struct jabber_buddy_ask_data *bla )
 {
-	presence_send_request( bla->gc, bla->handle, "subscribed" );
-	
-	if( find_buddy( bla->gc, bla->handle ) == NULL )
-		show_got_added( bla->gc, bla->handle, NULL );
+	presence_send_request( bla->ic, bla->handle, "subscribed" );
+	
+	if( find_buddy( bla->ic, bla->handle ) == NULL )
+		show_got_added( bla->ic, bla->handle, NULL );
 	
 	g_free( bla->handle );
@@ -232,5 +232,5 @@
 static void jabber_buddy_ask_no( gpointer w, struct jabber_buddy_ask_data *bla )
 {
-	presence_send_request( bla->gc, bla->handle, "subscribed" );
+	presence_send_request( bla->ic, bla->handle, "subscribed" );
 	
 	g_free( bla->handle );
@@ -238,14 +238,14 @@
 }
 
-void jabber_buddy_ask( struct gaim_connection *gc, char *handle )
+void jabber_buddy_ask( struct im_connection *ic, char *handle )
 {
 	struct jabber_buddy_ask_data *bla = g_new0( struct jabber_buddy_ask_data, 1 );
 	char *buf;
 	
-	bla->gc = gc;
+	bla->ic = ic;
 	bla->handle = g_strdup( handle );
 	
 	buf = g_strdup_printf( "The user %s wants to add you to his/her buddy list.", handle );
-	do_ask_dialog( gc, buf, bla, jabber_buddy_ask_yes, jabber_buddy_ask_no );
+	do_ask_dialog( ic, buf, bla, jabber_buddy_ask_yes, jabber_buddy_ask_no );
 	g_free( buf );
 }
@@ -271,7 +271,7 @@
    to deal with that properly. Set their ->resource property to NULL. Do *NOT*
    allow to mix this stuff, though... */
-struct jabber_buddy *jabber_buddy_add( struct gaim_connection *gc, char *full_jid_ )
-{
-	struct jabber_data *jd = gc->proto_data;
+struct jabber_buddy *jabber_buddy_add( struct im_connection *ic, char *full_jid_ )
+{
+	struct jabber_data *jd = ic->proto_data;
 	struct jabber_buddy *bud, *new, *bi;
 	char *s, *full_jid;
@@ -343,7 +343,7 @@
    asked for a bare JID, it uses the "resource_select" setting to see which
    resource to pick. */
-struct jabber_buddy *jabber_buddy_by_jid( struct gaim_connection *gc, char *jid_, get_buddy_flags_t flags )
-{
-	struct jabber_data *jd = gc->proto_data;
+struct jabber_buddy *jabber_buddy_by_jid( struct im_connection *ic, char *jid_, get_buddy_flags_t flags )
+{
+	struct jabber_data *jd = ic->proto_data;
 	struct jabber_buddy *bud;
 	char *s, *jid;
@@ -371,8 +371,8 @@
 		}
 		
-		if( bud == NULL && ( flags & GET_BUDDY_CREAT ) && find_buddy( gc, jid ) )
+		if( bud == NULL && ( flags & GET_BUDDY_CREAT ) && find_buddy( ic, jid ) )
 		{
 			*s = '/';
-			bud = jabber_buddy_add( gc, jid );
+			bud = jabber_buddy_add( ic, jid );
 		}
 		
@@ -391,6 +391,6 @@
 		if( bud == NULL )
 			/* No match. Create it now? */
-			return ( ( flags & GET_BUDDY_CREAT ) && find_buddy( gc, jid_ ) ) ?
-			           jabber_buddy_add( gc, jid_ ) : NULL;
+			return ( ( flags & GET_BUDDY_CREAT ) && find_buddy( ic, jid_ ) ) ?
+			           jabber_buddy_add( ic, jid_ ) : NULL;
 		else if( bud->resource && ( flags & GET_BUDDY_EXACT ) )
 			/* We want an exact match, so in thise case there shouldn't be a /resource. */
@@ -409,5 +409,5 @@
 		}
 		
-		if( ( set = set_getstr( &gc->acc->set, "resource_select" ) ) == NULL )
+		if( ( set = set_getstr( &ic->acc->set, "resource_select" ) ) == NULL )
 			return NULL;
 		else if( strcmp( set, "activity" ) == 0 )
@@ -421,7 +421,7 @@
    off-line (because (s)he can still be online from a different location.
    XXX: See above, we should accept bare JIDs too... */
-int jabber_buddy_remove( struct gaim_connection *gc, char *full_jid_ )
-{
-	struct jabber_data *jd = gc->proto_data;
+int jabber_buddy_remove( struct im_connection *ic, char *full_jid_ )
+{
+	struct jabber_data *jd = ic->proto_data;
 	struct jabber_buddy *bud, *prev, *bi;
 	char *s, *full_jid;
@@ -495,7 +495,7 @@
    specified bare JID. Use this when removing someone from the contact
    list, for example. */
-int jabber_buddy_remove_bare( struct gaim_connection *gc, char *bare_jid_ )
-{
-	struct jabber_data *jd = gc->proto_data;
+int jabber_buddy_remove_bare( struct im_connection *ic, char *bare_jid_ )
+{
+	struct jabber_data *jd = ic->proto_data;
 	struct jabber_buddy *bud, *next;
 	char *bare_jid;
Index: protocols/jabber/message.c
===================================================================
--- protocols/jabber/message.c	(revision 21782b3d081a3ac0d6c7c0e57736e4342b73779a)
+++ protocols/jabber/message.c	(revision 0da65d5fb37691ed4d31f7ab4058732f1440db6b)
@@ -26,5 +26,5 @@
 xt_status jabber_pkt_message( struct xt_node *node, gpointer data )
 {
-	struct gaim_connection *gc = data;
+	struct im_connection *ic = data;
 	char *from = xt_find_attr( node, "from" );
 	char *type = xt_find_attr( node, "type" );
@@ -47,5 +47,5 @@
 		if( ( s = strchr( from, '/' ) ) )
 		{
-			if( ( bud = jabber_buddy_by_jid( gc, from, GET_BUDDY_EXACT ) ) )
+			if( ( bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT ) ) )
 				bud->last_act = time( NULL );
 			else
@@ -76,5 +76,5 @@
 		
 		if( fullmsg->len > 0 )
-			serv_got_im( gc, bud ? bud->bare_jid : from, fullmsg->str, 0, 0, fullmsg->len );
+			serv_got_im( ic, bud ? bud->bare_jid : from, fullmsg->str, 0, 0, fullmsg->len );
 		
 		g_string_free( fullmsg, TRUE );
@@ -84,5 +84,5 @@
 		{
 			bud->flags |= JBFLAG_DOES_XEP85;
-			serv_got_typing( gc, bud ? bud->bare_jid : from, 0, 1 );
+			serv_got_typing( ic, bud ? bud->bare_jid : from, 0, 1 );
 		}
 		/* No need to send a "stopped typing" signal when there's a message. */
@@ -90,10 +90,10 @@
 		{
 			bud->flags |= JBFLAG_DOES_XEP85;
-			serv_got_typing( gc, bud ? bud->bare_jid : from, 0, 0 );
+			serv_got_typing( ic, bud ? bud->bare_jid : from, 0, 0 );
 		}
 		else if( xt_find_node( node->children, "paused" ) )
 		{
 			bud->flags |= JBFLAG_DOES_XEP85;
-			serv_got_typing( gc, bud ? bud->bare_jid : from, 0, 2 );
+			serv_got_typing( ic, bud ? bud->bare_jid : from, 0, 2 );
 		}
 		
Index: protocols/jabber/presence.c
===================================================================
--- protocols/jabber/presence.c	(revision 21782b3d081a3ac0d6c7c0e57736e4342b73779a)
+++ protocols/jabber/presence.c	(revision 0da65d5fb37691ed4d31f7ab4058732f1440db6b)
@@ -26,5 +26,5 @@
 xt_status jabber_pkt_presence( struct xt_node *node, gpointer data )
 {
-	struct gaim_connection *gc = data;
+	struct im_connection *ic = data;
 	char *from = xt_find_attr( node, "from" );
 	char *type = xt_find_attr( node, "type" );	/* NULL should mean the person is online. */
@@ -38,8 +38,8 @@
 	if( type == NULL )
 	{
-		if( !( bud = jabber_buddy_by_jid( gc, from, GET_BUDDY_EXACT | GET_BUDDY_CREAT ) ) )
+		if( !( bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT | GET_BUDDY_CREAT ) ) )
 		{
-			if( set_getbool( &gc->irc->set, "debug" ) )
-				serv_got_crap( gc, "WARNING: Could not handle presence information from JID: %s", from );
+			if( set_getbool( &ic->irc->set, "debug" ) )
+				serv_got_crap( ic, "WARNING: Could not handle presence information from JID: %s", from );
 			return XT_HANDLED;
 		}
@@ -66,17 +66,17 @@
 			bud->priority = 0;
 		
-		serv_got_update( gc, bud->bare_jid, 1, 0, 0, 0,
+		serv_got_update( ic, bud->bare_jid, 1, 0, 0, 0,
 		                 bud->away_state ? UC_UNAVAILABLE : 0, 0 );
 	}
 	else if( strcmp( type, "unavailable" ) == 0 )
 	{
-		if( jabber_buddy_by_jid( gc, from, GET_BUDDY_EXACT ) == NULL )
+		if( jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT ) == NULL )
 		{
-			if( set_getbool( &gc->irc->set, "debug" ) )
-				serv_got_crap( gc, "WARNING: Received presence information from unknown JID: %s", from );
+			if( set_getbool( &ic->irc->set, "debug" ) )
+				serv_got_crap( ic, "WARNING: Received presence information from unknown JID: %s", from );
 			return XT_HANDLED;
 		}
 		
-		jabber_buddy_remove( gc, from );
+		jabber_buddy_remove( ic, from );
 		
 		if( ( s = strchr( from, '/' ) ) )
@@ -86,6 +86,6 @@
 			/* Only count this as offline if there's no other resource
 			   available anymore. */
-			if( jabber_buddy_by_jid( gc, from, 0 ) == NULL )
-				serv_got_update( gc, from, 0, 0, 0, 0, 0, 0 );
+			if( jabber_buddy_by_jid( ic, from, 0 ) == NULL )
+				serv_got_update( ic, from, 0, 0, 0, 0, 0, 0 );
 			
 			*s = '/';
@@ -93,15 +93,15 @@
 		else
 		{
-			serv_got_update( gc, from, 0, 0, 0, 0, 0, 0 );
+			serv_got_update( ic, from, 0, 0, 0, 0, 0, 0 );
 		}
 	}
 	else if( strcmp( type, "subscribe" ) == 0 )
 	{
-		jabber_buddy_ask( gc, from );
+		jabber_buddy_ask( ic, from );
 	}
 	else if( strcmp( type, "subscribed" ) == 0 )
 	{
 		/* Not sure about this one, actually... */
-		serv_got_crap( gc, "%s just accepted your authorization request", from );
+		serv_got_crap( ic, "%s just accepted your authorization request", from );
 	}
 	else if( strcmp( type, "unsubscribe" ) == 0 || strcmp( type, "unsubscribed" ) == 0 )
@@ -131,7 +131,7 @@
 /* Whenever presence information is updated, call this function to inform the
    server. */
-int presence_send_update( struct gaim_connection *gc )
+int presence_send_update( struct im_connection *ic )
 {
-	struct jabber_data *jd = gc->proto_data;
+	struct jabber_data *jd = ic->proto_data;
 	struct xt_node *node;
 	char *show = jd->away_state->code;
@@ -140,5 +140,5 @@
 	
 	node = jabber_make_packet( "presence", NULL, NULL, NULL );
-	xt_add_child( node, xt_new_node( "priority", set_getstr( &gc->acc->set, "priority" ), NULL ) );
+	xt_add_child( node, xt_new_node( "priority", set_getstr( &ic->acc->set, "priority" ), NULL ) );
 	if( show && *show )
 		xt_add_child( node, xt_new_node( "show", show, NULL ) );
@@ -146,5 +146,5 @@
 		xt_add_child( node, xt_new_node( "status", status, NULL ) );
 	
-	st = jabber_write_packet( gc, node );
+	st = jabber_write_packet( ic, node );
 	
 	xt_free_node( node );
@@ -153,5 +153,5 @@
 
 /* Send a subscribe/unsubscribe request to a buddy. */
-int presence_send_request( struct gaim_connection *gc, char *handle, char *request )
+int presence_send_request( struct im_connection *ic, char *handle, char *request )
 {
 	struct xt_node *node;
@@ -162,5 +162,5 @@
 	xt_add_attr( node, "type", request );
 	
-	st = jabber_write_packet( gc, node );
+	st = jabber_write_packet( ic, node );
 	
 	xt_free_node( node );
Index: protocols/jabber/sasl.c
===================================================================
--- protocols/jabber/sasl.c	(revision 21782b3d081a3ac0d6c7c0e57736e4342b73779a)
+++ protocols/jabber/sasl.c	(revision 0da65d5fb37691ed4d31f7ab4058732f1440db6b)
@@ -27,16 +27,16 @@
 xt_status sasl_pkt_mechanisms( struct xt_node *node, gpointer data )
 {
-	struct gaim_connection *gc = data;
-	struct jabber_data *jd = gc->proto_data;
+	struct im_connection *ic = data;
+	struct jabber_data *jd = ic->proto_data;
 	struct xt_node *c, *reply;
 	char *s;
 	int sup_plain = 0, sup_digest = 0;
 	
-	if( !sasl_supported( gc ) )
+	if( !sasl_supported( ic ) )
 	{
 		/* Should abort this now, since we should already be doing
 		   IQ authentication. Strange things happen when you try
 		   to do both... */
-		serv_got_crap( gc, "XMPP 1.0 non-compliant server seems to support SASL, please report this as a BitlBee bug!" );
+		serv_got_crap( ic, "XMPP 1.0 non-compliant server seems to support SASL, please report this as a BitlBee bug!" );
 		return XT_HANDLED;
 	}
@@ -45,5 +45,5 @@
 	if( !s || strcmp( s, XMLNS_SASL ) != 0 )
 	{
-		signoff( gc );
+		signoff( ic );
 		return XT_ABORT;
 	}
@@ -62,6 +62,6 @@
 	if( !sup_plain && !sup_digest )
 	{
-		hide_login_progress( gc, "No known SASL authentication schemes supported" );
-		signoff( gc );
+		hide_login_progress( ic, "No known SASL authentication schemes supported" );
+		signoff( ic );
 		return XT_ABORT;
 	}
@@ -83,9 +83,9 @@
 		
 		/* With SASL PLAIN in XMPP, the text should be b64(\0user\0pass) */
-		len = strlen( jd->username ) + strlen( gc->acc->pass ) + 2;
+		len = strlen( jd->username ) + strlen( ic->acc->pass ) + 2;
 		s = g_malloc( len + 1 );
 		s[0] = 0;
 		strcpy( s + 1, jd->username );
-		strcpy( s + 2 + strlen( jd->username ), gc->acc->pass );
+		strcpy( s + 2 + strlen( jd->username ), ic->acc->pass );
 		reply->text = base64_encode( s, len );
 		reply->text_len = strlen( reply->text );
@@ -93,5 +93,5 @@
 	}
 	
-	if( !jabber_write_packet( gc, reply ) )
+	if( !jabber_write_packet( ic, reply ) )
 	{
 		xt_free_node( reply );
@@ -181,6 +181,6 @@
 xt_status sasl_pkt_challenge( struct xt_node *node, gpointer data )
 {
-	struct gaim_connection *gc = data;
-	struct jabber_data *jd = gc->proto_data;
+	struct im_connection *ic = data;
+	struct jabber_data *jd = ic->proto_data;
 	struct xt_node *reply = NULL;
 	char *nonce = NULL, *realm = NULL, *cnonce = NULL, cnonce_bin[30];
@@ -222,5 +222,5 @@
 		   I decided to call it H. */
 		md5_init( &H );
-		s = g_strdup_printf( "%s:%s:%s", jd->username, realm, gc->acc->pass );
+		s = g_strdup_printf( "%s:%s:%s", jd->username, realm, ic->acc->pass );
 		md5_append( &H, (unsigned char *) s, strlen( s ) );
 		g_free( s );
@@ -272,5 +272,5 @@
 	xt_add_attr( reply, "xmlns", XMLNS_SASL );
 	
-	if( !jabber_write_packet( gc, reply ) )
+	if( !jabber_write_packet( ic, reply ) )
 		goto silent_error;
 	
@@ -279,6 +279,6 @@
 
 error:
-	hide_login_progress( gc, "Incorrect SASL challenge received" );
-	signoff( gc );
+	hide_login_progress( ic, "Incorrect SASL challenge received" );
+	signoff( ic );
 
 silent_error:
@@ -296,6 +296,6 @@
 xt_status sasl_pkt_result( struct xt_node *node, gpointer data )
 {
-	struct gaim_connection *gc = data;
-	struct jabber_data *jd = gc->proto_data;
+	struct im_connection *ic = data;
+	struct jabber_data *jd = ic->proto_data;
 	char *s;
 	
@@ -303,5 +303,5 @@
 	if( !s || strcmp( s, XMLNS_SASL ) != 0 )
 	{
-		signoff( gc );
+		signoff( ic );
 		return XT_ABORT;
 	}
@@ -309,11 +309,11 @@
 	if( strcmp( node->name, "success" ) == 0 )
 	{
-		set_login_progress( gc, 1, "Authentication finished" );
+		set_login_progress( ic, 1, "Authentication finished" );
 		jd->flags |= JFLAG_AUTHENTICATED | JFLAG_STREAM_RESTART;
 	}
 	else if( strcmp( node->name, "failure" ) == 0 )
 	{
-		hide_login_progress( gc, "Authentication failure" );
-		signoff( gc );
+		hide_login_progress( ic, "Authentication failure" );
+		signoff( ic );
 		return XT_ABORT;
 	}
@@ -325,7 +325,7 @@
    It's done by checking if the <stream:stream> from the server has a
    version attribute. I don't know if this is the right way though... */
-gboolean sasl_supported( struct gaim_connection *gc )
-{
-	struct jabber_data *jd = gc->proto_data;
+gboolean sasl_supported( struct im_connection *ic )
+{
+	struct jabber_data *jd = ic->proto_data;
 	
 	return ( (void*) ( jd->xt && jd->xt->root && xt_find_attr( jd->xt->root, "version" ) ) ) != NULL;
