plugins/yay/yay.c

changeset 1557
190572c52915
parent 1554
1883d6c5fb5c
child 1562
18522055495a
--- a/plugins/yay/yay.c	Sat Mar 10 05:05:53 2001 +0000
+++ b/plugins/yay/yay.c	Sat Mar 10 09:30:31 2001 +0000
@@ -472,15 +472,27 @@
 
 static void gyahoo_remove_buddy(struct gaim_connection *gc, char *name) {
 	struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data;
-	struct yahoo_group *tmpgroup;
 	struct group *g = find_group_by_buddy(gc, name);
 	char *group = NULL;
 
 	if (g) {
 		group = g->name;
 	} else if (yd->sess && yd->sess->groups) {
-		tmpgroup = yd->sess->groups->data;
-		group = tmpgroup->name;
+		GList *x = yd->sess->groups;
+		while (x) {
+			struct yahoo_group *tmpgroup = x->data;
+			char **bds = tmpgroup->buddies;
+			while (*bds) {
+				if (!strcmp(*bds, name))
+					break;
+				bds++;
+			}
+			if (*bds) {
+				group = tmpgroup->name;
+				break;
+			}
+			x = x->next;
+		}
 	} else {
 		group = "Buddies";
 	}

mercurial