diff src/protocols/irc/irc.c @ 4770:c4c28874ecd3

[gaim-migrate @ 5088] I want to go to sleep. This is drag-n-drop moving of buddies in the list. I think it works, but I didn't actually test it... I really should have though; I can't imagine it working fine as-is. ;) I'm holding off on the rest of my Edit Buddy List stuff for tomorrow... I love last minute things, don't I? Note: I created gaim_blist_members and gaim_blist_groups to reproduce the effects of the old groups GSList and the members GSList of the group struct that I removed. This is really sub-optimal and should be replaced to iterate the Buddy List directly. If someone wants to do that, please do. Even if you don't want to do that, just review the changes I made and make sure I didn't do anything stupid. It is past 6am and I'm a bit tired and prone to mistake making. Thanks. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Fri, 14 Mar 2003 11:38:21 +0000
parents c15e0699acae
children 1e28e7d802a1
line wrap: on
line diff
--- a/src/protocols/irc/irc.c	Fri Mar 14 08:27:13 2003 +0000
+++ b/src/protocols/irc/irc.c	Fri Mar 14 11:38:21 2003 +0000
@@ -61,7 +61,6 @@
 
 /* for win32 compatability */
 G_MODULE_IMPORT GSList *connections;
-G_MODULE_IMPORT GSList *groups;
 
 #ifndef INET6_ADDRSTRLEN
 #define INET6_ADDRSTRLEN 46
@@ -570,7 +569,7 @@
 handle_list(struct gaim_connection *gc, char *list)
 {
 	struct irc_data *id = gc->proto_data;
-	GSList *gr;
+	GSList *gr, *gr1;
 
 	id->str = g_string_append_c(id->str, ' ');
 	id->str = g_string_append(id->str, list);
@@ -579,10 +578,12 @@
 		return;
 
 	g_strdown(id->str->str);
-	gr = groups;
-	while (gr) {
-		GSList *m = ((struct group *)gr->data)->members;
-		while (m) {
+	gr = gaim_blist_groups();
+	gr1 = gr;
+	while (gr1) {
+		GSList *m = gaim_blist_members((struct group *)gr1->data);
+		GSList *m1 = m;
+		while (m1) {
 			struct buddy *b = m->data;
 			if(b->account->gc == gc) {
 				char *tmp = g_strdup(b->name);
@@ -598,10 +599,12 @@
 					serv_got_update(gc, b->name, 0, 0, 0, 0, 0);
 				g_free(tmp);
 			}
-			m = m->next;
+			m1 = m1->next;
 		}
-		gr = gr->next;
+		g_slist_free(m);
+		gr1 = gr1->next;
 	}
+	g_slist_free(gr);
 	g_string_free(id->str, TRUE);
 	id->str = g_string_new("");
 }
@@ -615,14 +618,16 @@
 	int n = g_snprintf(buf, sizeof(buf), "ISON");
 	gboolean found = FALSE;
 
-	GSList *gr = groups;
+	GSList *gr = gaim_blist_groups();
+	GSList *gr1 = gr;
 	if (!gr || id->bc)
 		return TRUE;
 
-	while (gr) {
+	while (gr1) {
 		struct group *g = gr->data;
-		GSList *m = g->members;
-		while (m) {
+		GSList *m = gaim_blist_members(g);
+		GSList *m1 = m;
+		while (m1) {
 			struct buddy *b = m->data;
 			if(b->account->gc == gc) {
 				if (n + strlen(b->name) + 2 > sizeof(buf)) {
@@ -635,10 +640,12 @@
 
 				found = TRUE;
 			}
-			m = m->next;
+			m1 = m1->next;
 		}
-		gr = gr->next;
+		g_slist_free(m);
+		gr1 = gr1->next;
 	}
+	g_slist_free(gr);
 
 	if (found) {
 		g_snprintf(buf + n, sizeof(buf) - n, "\r\n");