diff src/server.c @ 5234:890b29f00b68

[gaim-migrate @ 5604] Chats in the buddy list! You can now put chat rooms in your buddy list, and double-click them to join them, instead of having to do all that typing. I'm eventually gonna add auto-join support, so that ugly hack involving pouncing can go away. Someone should make some new artwork so we don't have 2 + icons next to each other in the menus. This also has some fixes to let gaim compile again, after the renaming of the buddy list files. This also fixes the problem with offline buddies not showing up in the list sometimes for accounts that didn't log in at startup. This probably fixes other stuff, but I can't remember any of it off the top of my head. I'm going to stop typing and let people play with this now. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 26 Apr 2003 20:30:43 +0000
parents 49f0de976037
children a75c799e3db7
line wrap: on
line diff
--- a/src/server.c	Sat Apr 26 20:05:01 2003 +0000
+++ b/src/server.c	Sat Apr 26 20:30:43 2003 +0000
@@ -498,9 +498,11 @@
 		GaimBlistNode *b = ((GaimBlistNode*)old_group)->child;
 
 		while (b) {
-			struct buddy *bd = (struct buddy *)b;
-			if (bd->account == g->account)
-				tobemoved = g_list_append(tobemoved, bd->name);
+			if(GAIM_BLIST_NODE_IS_BUDDY(b)) {
+				struct buddy *bd = (struct buddy *)b;
+				if (bd->account == g->account)
+					tobemoved = g_list_append(tobemoved, bd->name);
+			}
 			b = b->next;
 		}
 
@@ -601,7 +603,7 @@
 		prpl_info->warn(g, name, anon);
 }
 
-void serv_join_chat(struct gaim_connection *g, GList *data)
+void serv_join_chat(struct gaim_connection *g, GHashTable *data)
 {
 	GaimPluginProtocolInfo *prpl_info = NULL;
 
@@ -1194,25 +1196,19 @@
 
 struct chat_invite_data {
 	struct gaim_connection *gc;
-	GList *str;
+	GHashTable *components;
 };
 
 static void chat_invite_data_free(struct chat_invite_data *cid)
 {
-	GList *tmp = cid->str;
-	while (tmp) {
-		/* this is either a g_malloc'd char* or g_malloc'd int* */
-		g_free(tmp->data);
-		tmp = tmp->next;
-	}
-	if (cid->str)
-		g_list_free(cid->str);
+	if (cid->components)
+		g_hash_table_destroy(cid->components);
 	g_free(cid);
 }
 
 static void chat_invite_accept(struct chat_invite_data *cid)
 {
-	serv_join_chat(cid->gc, cid->str);
+	serv_join_chat(cid->gc, cid->components);
 
 	chat_invite_data_free(cid);
 }
@@ -1220,7 +1216,7 @@
 
 
 void serv_got_chat_invite(struct gaim_connection *gc, char *name,
-						  char *who, char *message, GList *data)
+						  char *who, char *message, GHashTable *data)
 {
 	char buf2[BUF_LONG];
 	struct chat_invite_data *cid = g_new0(struct chat_invite_data, 1);
@@ -1238,7 +1234,7 @@
 				   who, gc->username, name);
 
 	cid->gc = gc;
-	cid->str = data;
+	cid->components = data;
 
 	do_ask_dialog(_("Buddy Chat Invite"), buf2, cid, _("Accept"), chat_invite_accept, _("Cancel"), chat_invite_data_free, NULL, FALSE);
 }