changeset 1083:12478dd1e9d7

[gaim-migrate @ 1093] yeah committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 11 Nov 2000 06:57:57 +0000
parents 13df4e342cff
children fb49b3f93726
files src/buddy.c src/prpl.h
diffstat 2 files changed, 18 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/buddy.c	Fri Nov 10 23:26:57 2000 +0000
+++ b/src/buddy.c	Sat Nov 11 06:57:57 2000 +0000
@@ -270,13 +270,13 @@
 		m = g->members;
 		while (m) {
 			b = (struct buddy_show *)m->data;
-			if (g_slist_length(b->connlist) == 1 && b->connlist->data == gc) {
+			if ((g_slist_length(b->connlist) == 1) && (b->connlist->data == gc)) {
 				if (b->log_timer > 0)
 					gtk_timeout_remove(b->log_timer);
 				b->connlist = g_slist_remove(b->connlist, gc);
 				gtk_container_remove(GTK_CONTAINER(g->tree), b->item);
-				g->members = g_slist_remove(g->members, b);
-				if (g->members == NULL) {
+				m = g->members = g_slist_remove(g->members, b);
+				if ((g->members == NULL) && (display_options & OPT_DISP_NO_MT_GRP)) {
 					shows = g_slist_remove(shows, g);
 					gtk_container_remove(GTK_CONTAINER(buddies), g->item);
 					g_free(g->name);
@@ -284,12 +284,13 @@
 					m = NULL;
 					remove_group = TRUE;
 				} else
-					m = g->members;
+					update_num_group(g);
 				g_free(b->name);
 				g_free(b->show);
 				g_free(b);
 			} else if (g_slist_find(b->connlist, gc)) {
-				b->connlist = g_slist_remove(b->connlist, gc);
+				if (g_slist_find(b->connlist, gc))
+					b->connlist = g_slist_remove(b->connlist, gc);
 				m = g_slist_next(m);
 			} else
 				m = g_slist_next(m);
@@ -491,7 +492,6 @@
 		if (bs) {
 			if (g_slist_find(bs->connlist, gc)) {
 				bs->connlist = g_slist_remove(bs->connlist, gc);
-				update_num_group(gs);
 				if (!g_slist_length(bs->connlist)) {
 					gs->members = g_slist_remove(gs->members, bs);
 					if (bs->log_timer > 0)
@@ -500,13 +500,16 @@
 					g_free(bs->show);
 					g_free(bs->name);
 					g_free(bs);
-					if (!g_slist_length(gs->members)) {
+					if (!g_slist_length(gs->members) &&
+							(display_options & OPT_DISP_NO_MT_GRP)) {
 						shows = g_slist_remove(shows, gs);
 						gtk_container_remove(GTK_CONTAINER(buddies), gs->item);
 						g_free(gs->name);
 						g_free(gs);
-					}
-				}
+					} else
+						update_num_group(gs);
+				} else
+					update_num_group(gs);
 			}
 		}
 	}
@@ -549,7 +552,8 @@
 
 	while(delg->members) {
 		delb = (struct buddy *)delg->members->data;
-		remove_buddy(gc, delg, delb);
+		remove_buddy(gc, delg, delb); /* this should take care of removing
+						 the group_show if necessary */
                 serv_remove_buddy(gc, delb->name);
 	}
 
@@ -1529,12 +1533,13 @@
 		struct group_show *g = find_gs_by_bs(b);
 		g->members = g_slist_remove(g->members, b);
 		gtk_container_remove(GTK_CONTAINER(g->tree), b->item);
-		if (g->members == NULL && (display_options & OPT_DISP_NO_MT_GRP)) {
+		if ((g->members == NULL) && (display_options & OPT_DISP_NO_MT_GRP)) {
 			shows = g_slist_remove(shows, g);
 			gtk_container_remove(GTK_CONTAINER(buddies), g->item);
 			g_free(g->name);
 			g_free(g);
-		}
+		} else
+			update_num_group(g);
 		g_free(b->name);
 		g_free(b->show);
 		g_free(b);
--- a/src/prpl.h	Fri Nov 10 23:26:57 2000 +0000
+++ b/src/prpl.h	Sat Nov 11 06:57:57 2000 +0000
@@ -32,6 +32,7 @@
 #define PROTO_IRC	5
 #define PROTO_FTP	6
 #define PROTO_VGATE	7
+#define PROTO_JABBER	8
 
 typedef void (*proto_init)(struct prpl *);