plugins/jabber/jabber.c

changeset 1359
a916579e2f87
parent 1354
02360502fa32
child 1362
1d5b2a1e8dab
--- a/plugins/jabber/jabber.c	Fri Dec 22 04:52:32 2000 +0000
+++ b/plugins/jabber/jabber.c	Fri Dec 22 05:15:44 2000 +0000
@@ -452,6 +452,8 @@
 	xmlnode y;
 	char *show;
 	int state;
+	GSList *resources;
+	char *res;
 
 	to = xmlnode_get_attrib(p->x, "to");
 	from = xmlnode_get_attrib(p->x, "from");
@@ -485,11 +487,26 @@
 		build_edit_tree();
 		do_export(NULL, NULL);
 	}
+	resources = b->proto_data;
+	res = who->resource;
+	while (resources) {
+		if (!strcmp(res, resources->data))
+			break;
+		resources = resources->next;
+	}
 
-	if (type && (strcasecmp(type, "unavailable") == 0))
-		serv_got_update(GJ_GC(j), buddy, 0, 0, 0, 0, 0, 0);
-	else
+	if (type && (strcasecmp(type, "unavailable") == 0)) {
+		g_free(resources->data);
+		b->proto_data = g_slist_remove(b->proto_data, resources->data);
+		if (!b->proto_data) {
+			serv_got_update(GJ_GC(j), buddy, 0, 0, 0, 0, 0, 0);
+		}
+	} else {
+		if (!resources) {
+			b->proto_data = g_slist_append(b->proto_data, g_strdup(res));
+		}
 		serv_got_update(GJ_GC(j), buddy, 1, 0, 0, 0, state, 0);
+	}
 
 	g_free(buddy);
 
@@ -825,6 +842,8 @@
 	ret->list_icon = jabber_list_icon;
 	ret->action_menu = NULL;
 	ret->user_opts = NULL;
+	ret->draw_new_user = NULL;
+	ret->do_new_user = NULL;
 	ret->login = jabber_login;
 	ret->close = jabber_close;
 	ret->send_im = jabber_send_im;

mercurial