diff libpurple/protocols/jabber/chat.c @ 28373:63dc67b32577

jabber: Use the newly refactored code to simplify "Initiate Chat".
author Paul Aurich <paul@darkrain42.org>
date Mon, 12 Oct 2009 18:24:37 +0000
parents 724e77faee1a
children ef513141e960
line wrap: on
line diff
--- a/libpurple/protocols/jabber/chat.c	Mon Oct 12 18:11:32 2009 +0000
+++ b/libpurple/protocols/jabber/chat.c	Mon Oct 12 18:24:37 2009 +0000
@@ -226,10 +226,16 @@
 	chat->handle = g_strdup(handle);
 
 	/* Copy the data hash table to chat->components */
-	/* TODO: Create entries in data table if data is NULL... */
 	chat->components = g_hash_table_new_full(g_str_hash, g_str_equal,
 			g_free, g_free);
-	g_hash_table_foreach(data, insert_in_hash_table, chat->components);
+	if (data == NULL) {
+		g_hash_table_insert(chat->components, g_strdup("handle"), g_strdup(handle));
+		g_hash_table_insert(chat->components, g_strdup("room"), g_strdup(room));
+		g_hash_table_insert(chat->components, g_strdup("server"), g_strdup(server));
+		/* g_hash_table_insert(chat->components, g_strdup("password"), g_strdup(server)); */
+	} else {
+		g_hash_table_foreach(data, insert_in_hash_table, chat->components);
+	}
 
 	chat->members = g_hash_table_new_full(g_str_hash, g_str_equal, NULL,
 			(GDestroyNotify)jabber_chat_member_free);