Index: account.c
===================================================================
--- account.c	(revision 5c9512ffa716f2bc8bbf9e2c31ee40624a0ff842)
+++ account.c	(revision 0a3c243b6659dc10efb227e507f324c2711d6dcd)
@@ -143,6 +143,4 @@
 void account_on( irc_t *irc, account_t *a )
 {
-	struct aim_user *u;
-	
 	if( a->gc )
 	{
@@ -153,15 +151,6 @@
 	cancel_auto_reconnect( a );
 	
-	u = g_new0 ( struct aim_user, 1 );
-	u->irc = irc;
-	u->prpl = a->prpl;
-	strncpy( u->username, a->user, sizeof( u->username ) - 1 );
-	strncpy( u->password, a->pass, sizeof( u->password ) - 1 );
-	if( a->server) strncpy( u->proto_opt[0], a->server, sizeof( u->proto_opt[0] ) - 1 );
-	
-	a->gc = (struct gaim_connection *) u; /* Bit hackish :-/ */
 	a->reconnect = 0;
-	
-	a->prpl->login( u );
+	a->prpl->login( a );
 }
 
Index: irc.c
===================================================================
--- irc.c	(revision 5c9512ffa716f2bc8bbf9e2c31ee40624a0ff842)
+++ irc.c	(revision 0a3c243b6659dc10efb227e507f324c2711d6dcd)
@@ -925,11 +925,11 @@
 {
 	char *nick, *s;
-	char reason[64];
+	char reason[128];
 	
 	if( u->gc && u->gc->flags & OPT_LOGGING_OUT )
 	{
-		if( u->gc->user->proto_opt[0][0] )
+		if( u->gc->acc->server )
 			g_snprintf( reason, sizeof( reason ), "%s %s", irc->myhost,
-			            u->gc->user->proto_opt[0] );
+			            u->gc->acc->server );
 		else if( ( s = strchr( u->gc->username, '@' ) ) )
 			g_snprintf( reason, sizeof( reason ), "%s %s", irc->myhost,
@@ -937,5 +937,5 @@
 		else
 			g_snprintf( reason, sizeof( reason ), "%s %s.%s", irc->myhost,
-			            u->gc->prpl->name, irc->myhost );
+			            u->gc->acc->prpl->name, irc->myhost );
 		
 		/* proto_opt might contain garbage after the : */
@@ -1013,5 +1013,5 @@
 		else if( g_strncasecmp( s + 1, "TYPING", 6 ) == 0 )
 		{
-			if( u && u->gc && u->gc->prpl->send_typing && strlen( s ) >= 10 )
+			if( u && u->gc && u->gc->acc->prpl->send_typing && strlen( s ) >= 10 )
 			{
 				time_t current_typing_notice = time( NULL );
@@ -1019,5 +1019,5 @@
 				if( current_typing_notice - u->last_typing_notice >= 5 )
 				{
-					u->gc->prpl->send_typing( u->gc, u->handle, s[8] == '1' );
+					u->gc->acc->prpl->send_typing( u->gc, u->handle, s[8] == '1' );
 					u->last_typing_notice = current_typing_notice;
 				}
@@ -1052,5 +1052,5 @@
 		}
 	}
-	else if( c && c->gc && c->gc->prpl )
+	else if( c && c->gc && c->gc->acc && c->gc->acc->prpl )
 	{
 		return( bim_chat_msg( c->gc, c->id, s ) );
Index: irc_commands.c
===================================================================
--- irc_commands.c	(revision 5c9512ffa716f2bc8bbf9e2c31ee40624a0ff842)
+++ irc_commands.c	(revision 0a3c243b6659dc10efb227e507f324c2711d6dcd)
@@ -150,8 +150,8 @@
 		irc_part( irc, u, c->channel );
 		
-		if( c->gc && c->gc->prpl )
+		if( c->gc )
 		{
 			c->joined = 0;
-			c->gc->prpl->chat_leave( c->gc, c->id );
+			c->gc->acc->prpl->chat_leave( c->gc, c->id );
 		}
 	}
@@ -173,9 +173,9 @@
 			user_t *u = user_find( irc, cmd[1] + 1 );
 			
-			if( u && u->gc && u->gc->prpl && u->gc->prpl->chat_open )
+			if( u && u->gc && u->gc->acc->prpl->chat_open )
 			{
 				irc_reply( irc, 403, "%s :Initializing groupchat in a different channel", cmd[1] );
 				
-				if( !u->gc->prpl->chat_open( u->gc, u->handle ) )
+				if( !u->gc->acc->prpl->chat_open( u->gc, u->handle ) )
 				{
 					irc_usermsg( irc, "Could not open a groupchat with %s.", u->nick );
@@ -205,7 +205,7 @@
 	
 	if( u && c && ( u->gc == c->gc ) )
-		if( c->gc && c->gc->prpl && c->gc->prpl->chat_invite )
-		{
-			c->gc->prpl->chat_invite( c->gc, c->id, "", u->handle );
+		if( c->gc && c->gc->acc->prpl->chat_invite )
+		{
+			c->gc->acc->prpl->chat_invite( c->gc, c->id, "", u->handle );
 			irc_reply( irc, 341, "%s %s", nick, channel );
 			return;
@@ -477,6 +477,6 @@
 		
 		if( u->gc )
-			irc_reply( irc, 312, "%s %s.%s :%s network", u->nick, u->gc->user->username,
-			           *u->gc->user->proto_opt[0] ? u->gc->user->proto_opt[0] : "", u->gc->prpl->name );
+			irc_reply( irc, 312, "%s %s.%s :%s network", u->nick, u->gc->acc->user,
+			           *u->gc->acc->server ? u->gc->acc->server : "", u->gc->acc->prpl->name );
 		else
 			irc_reply( irc, 312, "%s %s :%s", u->nick, irc->myhost, IRCD_INFO );
Index: protocols/jabber/jabber.c
===================================================================
--- protocols/jabber/jabber.c	(revision 5c9512ffa716f2bc8bbf9e2c31ee40624a0ff842)
+++ protocols/jabber/jabber.c	(revision 0a3c243b6659dc10efb227e507f324c2711d6dcd)
@@ -561,5 +561,5 @@
 static void gjab_start(gjconn gjc)
 {
-	struct aim_user *user;
+	account_t *acc;
 	int port = -1, ssl = 0;
 	char *server = NULL, *s;
@@ -568,9 +568,9 @@
 		return;
 
-	user = GJ_GC(gjc)->user;
-	if (*user->proto_opt[0]) {
+	acc = GJ_GC(gjc)->acc;
+	if (acc->server) {
 		/* If there's a dot, assume there's a hostname in the beginning */
-		if (strchr(user->proto_opt[0], '.')) {
-			server = g_strdup(user->proto_opt[0]);
+		if (strchr(acc->server, '.')) {
+			server = g_strdup(acc->server);
 			if ((s = strchr(server, ':')))
 				*s = 0;
@@ -578,10 +578,10 @@
 		
 		/* After the hostname, there can be a port number */
-		s = strchr(user->proto_opt[0], ':');
+		s = strchr(acc->server, ':');
 		if (s && isdigit(s[1]))
 			sscanf(s + 1, "%d", &port);
 		
 		/* And if there's the string ssl, the user wants an SSL-connection */
-		if (strstr(user->proto_opt[0], ":ssl") || g_strcasecmp(user->proto_opt[0], "ssl") == 0)
+		if (strstr(acc->server, ":ssl") || g_strcasecmp(acc->server, "ssl") == 0)
 			ssl = 1;
 	}
@@ -616,5 +616,5 @@
 	g_free(server);
 	
-	if (!user->gc || (gjc->fd < 0)) {
+	if (!acc->gc || (gjc->fd < 0)) {
 		STATE_EVT(JCONN_STATE_OFF)
 		return;
@@ -1516,9 +1516,9 @@
 }
 
-static void jabber_login(struct aim_user *user)
-{
-	struct gaim_connection *gc = new_gaim_conn(user);
+static void jabber_login(account_t *acc)
+{
+	struct gaim_connection *gc = new_gaim_conn(acc);
 	struct jabber_data *jd = gc->proto_data = g_new0(struct jabber_data, 1);
-	char *loginname = create_valid_jid(user->username, DEFAULT_SERVER, "BitlBee");
+	char *loginname = create_valid_jid(acc->user, DEFAULT_SERVER, "BitlBee");
 
 	jd->hash = g_hash_table_new(g_str_hash, g_str_equal);
@@ -1527,5 +1527,5 @@
 	set_login_progress(gc, 1, _("Connecting"));
 
-	if (!(jd->gjc = gjab_new(loginname, user->password, gc))) {
+	if (!(jd->gjc = gjab_new(loginname, acc->pass, gc))) {
 		g_free(loginname);
 		hide_login_progress(gc, _("Unable to connect"));
Index: protocols/msn/msn.c
===================================================================
--- protocols/msn/msn.c	(revision 5c9512ffa716f2bc8bbf9e2c31ee40624a0ff842)
+++ protocols/msn/msn.c	(revision 0a3c243b6659dc10efb227e507f324c2711d6dcd)
@@ -27,7 +27,7 @@
 #include "msn.h"
 
-static void msn_login( struct aim_user *acct )
-{
-	struct gaim_connection *gc = new_gaim_conn( acct );
+static void msn_login( account_t *acc )
+{
+	struct gaim_connection *gc = new_gaim_conn( acc );
 	struct msn_data *md = g_new0( struct msn_data, 1 );
 	
@@ -37,5 +37,5 @@
 	md->fd = -1;
 	
-	if( strchr( acct->username, '@' ) == NULL )
+	if( strchr( acc->user, '@' ) == NULL )
 	{
 		hide_login_progress( gc, "Invalid account name" );
Index: protocols/nogaim.c
===================================================================
--- protocols/nogaim.c	(revision 5c9512ffa716f2bc8bbf9e2c31ee40624a0ff842)
+++ protocols/nogaim.c	(revision 0a3c243b6659dc10efb227e507f324c2711d6dcd)
@@ -145,31 +145,19 @@
 /* multi.c */
 
-struct gaim_connection *new_gaim_conn( struct aim_user *user )
+struct gaim_connection *new_gaim_conn( account_t *acc )
 {
 	struct gaim_connection *gc;
-	account_t *a;
 	
 	gc = g_new0( struct gaim_connection, 1 );
 	
-	gc->prpl = user->prpl;
-	g_snprintf( gc->username, sizeof( gc->username ), "%s", user->username );
-	g_snprintf( gc->password, sizeof( gc->password ), "%s", user->password );
-	/* [MD]	BUGFIX: don't set gc->irc to the global IRC, but use the one from the struct aim_user.
-	 * This fixes daemon mode breakage where IRC doesn't point to the currently active connection.
-	 */
-	gc->irc = user->irc;
+	/* Maybe we should get rid of this memory waste later. ;-) */
+	g_snprintf( gc->username, sizeof( gc->username ), "%s", acc->user );
+	g_snprintf( gc->password, sizeof( gc->password ), "%s", acc->pass );
+	
+	gc->irc = acc->irc;
+	gc->acc = acc;
+	acc->gc = gc;
 	
 	connections = g_slist_append( connections, gc );
-	
-	user->gc = gc;
-	gc->user = user;
-	
-	// Find the account_t so we can set its gc pointer
-	for( a = gc->irc->accounts; a; a = a->next )
-		if( ( struct aim_user * ) a->gc == user )
-		{
-			a->gc = gc;
-			break;
-		}
 	
 	return( gc );
@@ -189,5 +177,4 @@
 	
 	connections = g_slist_remove( connections, gc );
-	g_free( gc->user );
 	g_free( gc );
 }
@@ -226,12 +213,12 @@
 	/* Try to find a different connection on the same protocol. */
 	for( a = gc->irc->accounts; a; a = a->next )
-		if( a->prpl == gc->prpl && a->gc != gc )
+		if( a->prpl == gc->acc->prpl && a->gc != gc )
 			break;
 	
 	/* If we found one, include the screenname in the message. */
 	if( a )
-		irc_usermsg( gc->irc, "%s(%s) - %s", gc->prpl->name, gc->username, text );
+		irc_usermsg( gc->irc, "%s(%s) - %s", gc->acc->prpl->name, gc->username, text );
 	else
-		irc_usermsg( gc->irc, "%s - %s", gc->prpl->name, text );
+		irc_usermsg( gc->irc, "%s - %s", gc->acc->prpl->name, text );
 	
 	g_free( text );
@@ -242,6 +229,6 @@
 	struct gaim_connection *gc = d;
 	
-	if( gc->prpl && gc->prpl->keepalive )
-		gc->prpl->keepalive( gc );
+	if( gc->acc->prpl->keepalive )
+		gc->acc->prpl->keepalive( gc );
 	
 	return TRUE;
@@ -299,5 +286,5 @@
 	
 	gc->keepalive = 0;
-	gc->prpl->close( gc );
+	gc->acc->prpl->close( gc );
 	b_event_remove( gc->inpa );
 	
@@ -379,5 +366,5 @@
 	
 	memset( nick, 0, MAX_NICK_LENGTH + 1 );
-	strcpy( nick, nick_get( gc->irc, handle, gc->prpl, realname ) );
+	strcpy( nick, nick_get( gc->irc, handle, gc->acc->prpl, realname ) );
 	
 	u = user_add( gc->irc, nick );
@@ -391,13 +378,13 @@
 		u->user = g_strndup( handle, s - handle );
 	}
-	else if( gc->user->proto_opt[0] && *gc->user->proto_opt[0] )
+	else if( *gc->acc->server )
 	{
 		char *colon;
 		
-		if( ( colon = strchr( gc->user->proto_opt[0], ':' ) ) )
-			u->host = g_strndup( gc->user->proto_opt[0],
-			                     colon - gc->user->proto_opt[0] );
+		if( ( colon = strchr( gc->acc->server, ':' ) ) )
+			u->host = g_strndup( gc->acc->server,
+			                     colon - gc->acc->server );
 		else
-			u->host = g_strdup( gc->user->proto_opt[0] );
+			u->host = g_strdup( gc->acc->server );
 		
 		u->user = g_strdup( handle );
@@ -410,5 +397,5 @@
 	else
 	{
-		u->host = g_strdup( gc->user->prpl->name );
+		u->host = g_strdup( gc->acc->prpl->name );
 		u->user = g_strdup( handle );
 	}
@@ -480,5 +467,5 @@
 void show_got_added_yes( gpointer w, struct show_got_added_data *data )
 {
-	data->gc->prpl->add_buddy( data->gc, data->handle );
+	data->gc->acc->prpl->add_buddy( data->gc, data->handle );
 	add_buddy( data->gc, NULL, data->handle, data->handle );
 	
@@ -559,9 +546,9 @@
 	}
 	
-	if( ( type & UC_UNAVAILABLE ) && ( !strcmp(gc->prpl->name, "oscar") || !strcmp(gc->prpl->name, "icq")) )
+	if( ( type & UC_UNAVAILABLE ) && ( strcmp( gc->acc->prpl->name, "oscar" ) == 0 || strcmp( gc->acc->prpl->name, "icq" ) == 0 ) )
 	{
 		u->away = g_strdup( "Away" );
 	}
-	else if( ( type & UC_UNAVAILABLE ) && ( !strcmp(gc->prpl->name, "jabber") ) )
+	else if( ( type & UC_UNAVAILABLE ) && ( strcmp( gc->acc->prpl->name, "jabber" ) == 0 ) )
 	{
 		if( type & UC_DND )
@@ -572,7 +559,7 @@
 			u->away = g_strdup( "Away" );
 	}
-	else if( ( type & UC_UNAVAILABLE ) && gc->prpl->get_status_string )
-	{
-		u->away = g_strdup( gc->prpl->get_status_string( gc, type ) );
+	else if( ( type & UC_UNAVAILABLE ) && gc->acc->prpl->get_status_string )
+	{
+		u->away = g_strdup( gc->acc->prpl->get_status_string( gc, type ) );
 	}
 	else
@@ -733,5 +720,5 @@
 	
 	/* Gaim sends own messages through this too. IRC doesn't want this, so kill them */
-	if( g_strcasecmp( who, gc->user->username ) == 0 )
+	if( g_strcasecmp( who, gc->username ) == 0 )
 		return;
 	
@@ -791,5 +778,5 @@
 	
 	/* It might be yourself! */
-	if( b->gc->prpl->cmp_buddynames( handle, b->gc->user->username ) == 0 )
+	if( b->gc->acc->prpl->cmp_buddynames( handle, b->gc->username ) == 0 )
 	{
 		u = user_find( b->gc->irc, b->gc->irc->nick );
@@ -825,5 +812,5 @@
 	
 	/* It might be yourself! */
-	if( g_strcasecmp( handle, b->gc->user->username ) == 0 )
+	if( g_strcasecmp( handle, b->gc->username ) == 0 )
 	{
 		u = user_find( b->gc->irc, b->gc->irc->nick );
@@ -959,5 +946,5 @@
 	}
 	
-	st = gc->prpl->send_im( gc, handle, msg, strlen( msg ), flags );
+	st = gc->acc->prpl->send_im( gc, handle, msg, strlen( msg ), flags );
 	g_free( buf );
 	
@@ -976,5 +963,5 @@
 	}
 	
-	st = gc->prpl->chat_send( gc, id, msg );
+	st = gc->acc->prpl->chat_send( gc, id, msg );
 	g_free( buf );
 	
@@ -990,5 +977,5 @@
 	
 	if( !away ) away = "";
-	ms = m = gc->prpl->away_states( gc );
+	ms = m = gc->acc->prpl->away_states( gc );
 	
 	while( m )
@@ -1011,5 +998,5 @@
 	if( m )
 	{
-		gc->prpl->set_away( gc, m->data, *away ? away : NULL );
+		gc->acc->prpl->set_away( gc, m->data, *away ? away : NULL );
 	}
 	else
@@ -1018,10 +1005,10 @@
 		if( s )
 		{
-			gc->prpl->set_away( gc, s, away );
+			gc->acc->prpl->set_away( gc, s, away );
 			if( set_getint( &gc->irc->set, "debug" ) )
 				serv_got_crap( gc, "Setting away state to %s", s );
 		}
 		else
-			gc->prpl->set_away( gc, GAIM_AWAY_CUSTOM, away );
+			gc->acc->prpl->set_away( gc, GAIM_AWAY_CUSTOM, away );
 	}
 	
@@ -1075,10 +1062,10 @@
 void bim_add_allow( struct gaim_connection *gc, char *handle )
 {
-	if( g_slist_find_custom( gc->permit, handle, (GCompareFunc) gc->prpl->cmp_buddynames ) == NULL )
+	if( g_slist_find_custom( gc->permit, handle, (GCompareFunc) gc->acc->prpl->cmp_buddynames ) == NULL )
 	{
 		gc->permit = g_slist_prepend( gc->permit, g_strdup( handle ) );
 	}
 	
-	gc->prpl->add_permit( gc, handle );
+	gc->acc->prpl->add_permit( gc, handle );
 }
 
@@ -1087,5 +1074,5 @@
 	GSList *l;
 	
-	if( ( l = g_slist_find_custom( gc->permit, handle, (GCompareFunc) gc->prpl->cmp_buddynames ) ) )
+	if( ( l = g_slist_find_custom( gc->permit, handle, (GCompareFunc) gc->acc->prpl->cmp_buddynames ) ) )
 	{
 		g_free( l->data );
@@ -1093,15 +1080,15 @@
 	}
 	
-	gc->prpl->rem_permit( gc, handle );
+	gc->acc->prpl->rem_permit( gc, handle );
 }
 
 void bim_add_block( struct gaim_connection *gc, char *handle )
 {
-	if( g_slist_find_custom( gc->deny, handle, (GCompareFunc) gc->prpl->cmp_buddynames ) == NULL )
+	if( g_slist_find_custom( gc->deny, handle, (GCompareFunc) gc->acc->prpl->cmp_buddynames ) == NULL )
 	{
 		gc->deny = g_slist_prepend( gc->deny, g_strdup( handle ) );
 	}
 	
-	gc->prpl->add_deny( gc, handle );
+	gc->acc->prpl->add_deny( gc, handle );
 }
 
@@ -1110,5 +1097,5 @@
 	GSList *l;
 	
-	if( ( l = g_slist_find_custom( gc->deny, handle, (GCompareFunc) gc->prpl->cmp_buddynames ) ) )
+	if( ( l = g_slist_find_custom( gc->deny, handle, (GCompareFunc) gc->acc->prpl->cmp_buddynames ) ) )
 	{
 		g_free( l->data );
@@ -1116,4 +1103,4 @@
 	}
 	
-	gc->prpl->rem_deny( gc, handle );
-}
+	gc->acc->prpl->rem_deny( gc, handle );
+}
Index: protocols/nogaim.h
===================================================================
--- protocols/nogaim.h	(revision 5c9512ffa716f2bc8bbf9e2c31ee40624a0ff842)
+++ protocols/nogaim.h	(revision 0a3c243b6659dc10efb227e507f324c2711d6dcd)
@@ -39,4 +39,5 @@
 
 #include "bitlbee.h"
+#include "account.h"
 #include "proxy.h"
 #include "md5.h"
@@ -63,5 +64,5 @@
 struct gaim_connection
 {
-	struct prpl *prpl;
+	account_t *acc;
 	guint32 flags;
 	
@@ -78,6 +79,4 @@
 	GSList *deny;
 	int permdeny;
-	
-	struct aim_user *user;
 	
 	char username[64];
@@ -126,24 +125,9 @@
 };
 
-struct aim_user {
-	char username[64];
-	char alias[SELF_ALIAS_LEN]; 
-	char password[32];
-	char user_info[2048];
-	int options;
-	struct prpl *prpl;
-	/* prpls can use this to save information about the user,
-	 * like which server to connect to, etc */
-	char proto_opt[7][256];
-
-	struct gaim_connection *gc;
-	irc_t *irc;
-};
-
 struct prpl {
 	int options;
 	const char *name;
 
-	void (* login)		(struct aim_user *);
+	void (* login)		(account_t *);
 	void (* keepalive)	(struct gaim_connection *);
 	void (* close)		(struct gaim_connection *);
@@ -212,5 +196,5 @@
 
 /* multi.c */
-G_MODULE_EXPORT struct gaim_connection *new_gaim_conn( struct aim_user *user );
+G_MODULE_EXPORT struct gaim_connection *new_gaim_conn( account_t *acc );
 G_MODULE_EXPORT void destroy_gaim_conn( struct gaim_connection *gc );
 G_MODULE_EXPORT void set_login_progress( struct gaim_connection *gc, int step, char *msg );
Index: protocols/oscar/oscar.c
===================================================================
--- protocols/oscar/oscar.c	(revision 5c9512ffa716f2bc8bbf9e2c31ee40624a0ff842)
+++ protocols/oscar/oscar.c	(revision 0a3c243b6659dc10efb227e507f324c2711d6dcd)
@@ -356,16 +356,16 @@
 }
 
-static void oscar_login(struct aim_user *user) {
+static void oscar_login(account_t *acc) {
 	aim_session_t *sess;
 	aim_conn_t *conn;
 	char buf[256];
-	struct gaim_connection *gc = new_gaim_conn(user);
+	struct gaim_connection *gc = new_gaim_conn(acc);
 	struct oscar_data *odata = gc->proto_data = g_new0(struct oscar_data, 1);
 
-	if (isdigit(*user->username)) {
+	if (isdigit(acc->user[0])) {
 		odata->icq = TRUE;
 		/* This is odd but it's necessary for a proper do_import and do_export.
 		   We don't do those anymore, but let's stick with it, just in case
-		   it accidentally fixes something else too... */
+		   it accidentally fixes something else too... </bitlbee> */
 		gc->password[8] = 0;
 	} else {
@@ -390,7 +390,7 @@
 	}
 	
-	if (g_strcasecmp(user->proto_opt[USEROPT_AUTH], "login.icq.com") != 0 &&
-	    g_strcasecmp(user->proto_opt[USEROPT_AUTH], "login.oscar.aol.com") != 0) {
-		serv_got_crap(gc, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",user->proto_opt[USEROPT_AUTH]);
+	if (g_strcasecmp(acc->server, "login.icq.com") != 0 &&
+	    g_strcasecmp(acc->server, "login.oscar.aol.com") != 0) {
+		serv_got_crap(gc, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",acc->server);
 	}
 	
@@ -402,9 +402,5 @@
 
 	conn->status |= AIM_CONN_STATUS_INPROGRESS;
-	conn->fd = proxy_connect(user->proto_opt[USEROPT_AUTH][0] ?
-					user->proto_opt[USEROPT_AUTH] : AIM_DEFAULT_LOGIN_SERVER,
-				 user->proto_opt[USEROPT_AUTHPORT][0] ?
-					atoi(user->proto_opt[USEROPT_AUTHPORT]) : AIM_LOGIN_PORT,
-				 oscar_login_connect, gc);
+	conn->fd = proxy_connect(acc->server, AIM_LOGIN_PORT, oscar_login_connect, gc);
 	if (conn->fd < 0) {
 		hide_login_progress(gc, _("Couldn't connect to host"));
@@ -485,12 +481,9 @@
 	struct aim_authresp_info *info;
 	int i; char *host; int port;
-	struct aim_user *user;
 	aim_conn_t *bosconn;
 
 	struct gaim_connection *gc = sess->aux_data;
         struct oscar_data *od = gc->proto_data;
-	user = gc->user;
-	port = user->proto_opt[USEROPT_AUTHPORT][0] ?
-		atoi(user->proto_opt[USEROPT_AUTHPORT]) : AIM_LOGIN_PORT,
+	port = AIM_LOGIN_PORT;
 
 	va_start(ap, fr);
@@ -871,5 +864,4 @@
 	struct aim_redirect_data *redir;
 	struct gaim_connection *gc = sess->aux_data;
-	struct aim_user *user = gc->user;
 	aim_conn_t *tstconn;
 	int i;
@@ -877,11 +869,9 @@
 	int port;
 
-	port = user->proto_opt[USEROPT_AUTHPORT][0] ?
-		atoi(user->proto_opt[USEROPT_AUTHPORT]) : AIM_LOGIN_PORT,
-
 	va_start(ap, fr);
 	redir = va_arg(ap, struct aim_redirect_data *);
 	va_end(ap);
 
+	port = AIM_LOGIN_PORT;
 	for (i = 0; i < (int)strlen(redir->ip); i++) {
 		if (redir->ip[i] == ':') {
@@ -1723,6 +1713,9 @@
 	odata->rights.maxsiglen = odata->rights.maxawaymsglen = (guint)maxsiglen;
 
+	/* FIXME: It seems we're not really using this, and it broke now that
+	   struct aim_user is dead.
 	aim_bos_setprofile(sess, fr->conn, gc->user->user_info, NULL, gaim_caps);
-
+	*/
+	
 	return 1;
 }
Index: protocols/yahoo/yahoo.c
===================================================================
--- protocols/yahoo/yahoo.c	(revision 5c9512ffa716f2bc8bbf9e2c31ee40624a0ff842)
+++ protocols/yahoo/yahoo.c	(revision 0a3c243b6659dc10efb227e507f324c2711d6dcd)
@@ -121,7 +121,7 @@
 }
 
-static void byahoo_login( struct aim_user *user )
-{
-	struct gaim_connection *gc = new_gaim_conn( user );
+static void byahoo_login( account_t *acc )
+{
+	struct gaim_connection *gc = new_gaim_conn( acc );
 	struct byahoo_data *yd = gc->proto_data = g_new0( struct byahoo_data, 1 );
 	
@@ -130,5 +130,5 @@
 	
 	set_login_progress( gc, 1, "Connecting" );
-	yd->y2_id = yahoo_init( user->username, user->password );
+	yd->y2_id = yahoo_init( acc->user, acc->pass );
 	yahoo_login( yd->y2_id, yd->current_status );
 }
@@ -425,5 +425,5 @@
 		yd = gc->proto_data;
 		
-		if( !strcmp(gc->prpl->name, "yahoo") && yd->y2_id == id )
+		if( strcmp( gc->acc->prpl->name, "yahoo" ) == 0 && yd->y2_id == id )
 			return( gc );
 	}
Index: root_commands.c
===================================================================
--- root_commands.c	(revision 5c9512ffa716f2bc8bbf9e2c31ee40624a0ff842)
+++ root_commands.c	(revision 0a3c243b6659dc10efb227e507f324c2711d6dcd)
@@ -400,5 +400,5 @@
 		else
 		{
-			nick_set( irc, cmd[2], a->gc->prpl, cmd[3] );
+			nick_set( irc, cmd[2], a->gc->acc->prpl, cmd[3] );
 		}
 	}
@@ -407,5 +407,5 @@
 	   add them to your *real* (server-side) contact list. */
 	if( add_for_real )
-		a->gc->prpl->add_buddy( a->gc, cmd[2] );
+		a->gc->acc->prpl->add_buddy( a->gc, cmd[2] );
 		
 	add_buddy( a->gc, NULL, cmd[2], cmd[2] );
@@ -441,5 +441,5 @@
 	}
 	
-	if( !gc->prpl->get_info )
+	if( !gc->acc->prpl->get_info )
 	{
 		irc_usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] );
@@ -447,5 +447,5 @@
 	else
 	{
-		gc->prpl->get_info( gc, cmd[2] );
+		gc->acc->prpl->get_info( gc, cmd[2] );
 	}
 }
@@ -482,5 +482,5 @@
 		else if( u->send_handler == buddy_send_handler )
 		{
-			nick_set( irc, u->handle, u->gc->prpl, cmd[2] );
+			nick_set( irc, u->handle, u->gc->acc->prpl, cmd[2] );
 		}
 		
@@ -501,5 +501,5 @@
 	s = g_strdup( u->handle );
 	
-	u->gc->prpl->remove_buddy( u->gc, u->handle, NULL );
+	u->gc->acc->prpl->remove_buddy( u->gc, u->handle, NULL );
 	user_del( irc, cmd[1] );
 	nick_del( irc, cmd[1] );
@@ -558,5 +558,5 @@
 	}
 	
-	if( !gc->prpl->add_deny || !gc->prpl->rem_permit )
+	if( !gc->acc->prpl->add_deny || !gc->acc->prpl->rem_permit )
 	{
 		irc_usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] );
@@ -617,5 +617,5 @@
 	}
 	
-	if( !gc->prpl->rem_deny || !gc->prpl->add_permit )
+	if( !gc->acc->prpl->rem_deny || !gc->acc->prpl->add_permit )
 	{
 		irc_usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] );
@@ -733,5 +733,5 @@
 		if( online == 1 )
 		{
-			g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name );
+			g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc->acc->prpl->name );
 			irc_usermsg( irc, format, u->nick, s, "Online" );
 		}
@@ -744,5 +744,5 @@
 		if( away == 1 )
 		{
-			g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name );
+			g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc->acc->prpl->name );
 			irc_usermsg( irc, format, u->nick, s, u->away );
 		}
@@ -754,5 +754,5 @@
 		if( offline == 1 )
 		{
-			g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name );
+			g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc->acc->prpl->name );
 			irc_usermsg( irc, format, u->nick, s, "Offline" );
 		}
@@ -779,5 +779,5 @@
 		irc_usermsg( irc, "Your name is `%s'" , a->gc->displayname ? a->gc->displayname : "NULL" );
 	}
-	else if ( !a->gc->prpl->set_info ) 
+	else if ( !a->prpl->set_info ) 
 	{
 		irc_usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] );
@@ -787,5 +787,5 @@
 		irc_usermsg( irc, "Setting your name to `%s'", cmd[2] );
 		
-		a->gc->prpl->set_info( a->gc, cmd[2] );
+		a->prpl->set_info( a->gc, cmd[2] );
 	}
 }
@@ -806,5 +806,5 @@
 	for( num = 0; q; q = q->next, num ++ )
 		if( q->gc ) /* Not necessary yet, but it might come later */
-			irc_usermsg( irc, "%d, %s(%s): %s", num, q->gc->prpl->name, q->gc->username, q->question );
+			irc_usermsg( irc, "%d, %s(%s): %s", num, q->gc->acc->prpl->name, q->gc->username, q->question );
 		else
 			irc_usermsg( irc, "%d, BitlBee: %s", num, q->question );
@@ -834,8 +834,9 @@
 			user_t *u;
 			
+			/* FIXME: Hmmm, this is actually pretty dangerous code... REMOVEME? :-) */
 			for( u = irc->users; u; u = u->next )
 				if( u->gc == gc )
 				{
-					u->gc->prpl->remove_buddy( u->gc, u->handle, NULL );
+					u->gc->acc->prpl->remove_buddy( u->gc, u->handle, NULL );
 					user_del( irc, u->nick );
 				}
@@ -852,7 +853,7 @@
 	for( n = gc->irc->nicks; n; n = n->next )
 	{
-		if( n->proto == gc->prpl && !user_findhandle( gc, n->handle ) )
-		{
-	                gc->prpl->add_buddy( gc, n->handle );
+		if( n->proto == gc->acc->prpl && !user_findhandle( gc, n->handle ) )
+		{
+	                gc->acc->prpl->add_buddy( gc, n->handle );
 	                add_buddy( gc, NULL, n->handle, NULL );
 		}
Index: user.c
===================================================================
--- user.c	(revision 5c9512ffa716f2bc8bbf9e2c31ee40624a0ff842)
+++ user.c	(revision 0a3c243b6659dc10efb227e507f324c2711d6dcd)
@@ -147,5 +147,5 @@
 	while( u )
 	{
-		if( u->gc == gc && u->handle && gc->prpl->cmp_buddynames ( u->handle, handle ) == 0 )
+		if( u->gc == gc && u->handle && gc->acc->prpl->cmp_buddynames ( u->handle, handle ) == 0 )
 			break;
 		u = u->next;
