Index: protocols/jabber/jabber.c
===================================================================
--- protocols/jabber/jabber.c	(revision 75cde5d1d58025d6eae027d82b26e896d83cb041)
+++ protocols/jabber/jabber.c	(revision 0a3c243b6659dc10efb227e507f324c2711d6dcd)
@@ -471,5 +471,5 @@
 }
 
-static void jabber_callback(gpointer data, gint source, GaimInputCondition condition)
+static gboolean jabber_callback(gpointer data, gint source, b_input_condition condition)
 {
 	struct gaim_connection *gc = (struct gaim_connection *)data;
@@ -477,4 +477,6 @@
 
 	gjab_recv(jd->gjc);
+	
+	return TRUE;
 }
 
@@ -487,5 +489,5 @@
 }
 
-static void gjab_connected(gpointer data, gint source, GaimInputCondition cond)
+static gboolean gjab_connected(gpointer data, gint source, b_input_condition cond)
 {
 	xmlnode x;
@@ -497,5 +499,5 @@
 	if (!g_slist_find(get_connections(), gc)) {
 		closesocket(source);
-		return;
+		return FALSE;
 	}
 
@@ -508,5 +510,5 @@
 	if (source == -1) {
 		STATE_EVT(JCONN_STATE_OFF)
-		return;
+		return FALSE;
 	}
 
@@ -530,8 +532,10 @@
 
 	gc = GJ_GC(gjc);
-	gc->inpa = gaim_input_add(gjc->fd, GAIM_INPUT_READ, jabber_callback, gc);
-}
-
-static void gjab_connected_ssl(gpointer data, void *source, GaimInputCondition cond)
+	gc->inpa = b_input_add(gjc->fd, GAIM_INPUT_READ, jabber_callback, gc);
+	
+	return FALSE;
+}
+
+static gboolean gjab_connected_ssl(gpointer data, void *source, b_input_condition cond)
 {
 	struct gaim_connection *gc = data;
@@ -544,18 +548,18 @@
 	if (source == NULL) {
 		STATE_EVT(JCONN_STATE_OFF)
-		return;
+		return FALSE;
 	}
 	
 	if (!g_slist_find(get_connections(), gc)) {
 		ssl_disconnect(source);
-		return;
+		return FALSE;
 	}
 	
-	gjab_connected(data, gjc->fd, cond);
+	return gjab_connected(data, gjc->fd, cond);
 }
 
 static void gjab_start(gjconn gjc)
 {
-	struct aim_user *user;
+	account_t *acc;
 	int port = -1, ssl = 0;
 	char *server = NULL, *s;
@@ -564,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;
@@ -574,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;
 	}
@@ -612,5 +616,5 @@
 	g_free(server);
 	
-	if (!user->gc || (gjc->fd < 0)) {
+	if (!acc->gc || (gjc->fd < 0)) {
 		STATE_EVT(JCONN_STATE_OFF)
 		return;
@@ -1512,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);
@@ -1523,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"));
@@ -1543,5 +1547,5 @@
 }
 
-static gboolean jabber_free(gpointer data)
+static gboolean jabber_free(gpointer data, gint fd, b_input_condition cond)
 {
 	struct jabber_data *jd = data;
@@ -1588,8 +1592,8 @@
 	}
 	if (gc->inpa)
-		gaim_input_remove(gc->inpa);
+		b_event_remove(gc->inpa);
 
 	if(jd) {
-		g_timeout_add(50, jabber_free, jd);
+		b_timeout_add(50, jabber_free, jd);
 		if(jd->gjc != NULL)
 			xmlnode_free(jd->gjc->current);
