diff src/roomlist.c @ 8199:12055bae7f59

[gaim-migrate @ 8922] marv made the roomlist widget a lot cooler. thanks marv! committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 01 Feb 2004 05:02:13 +0000
parents 596c64a2a2d0
children 77baefe979c6
line wrap: on
line diff
--- a/src/roomlist.c	Sun Feb 01 04:21:34 2004 +0000
+++ b/src/roomlist.c	Sun Feb 01 05:02:13 2004 +0000
@@ -29,6 +29,7 @@
 #include "connection.h"
 #include "debug.h"
 #include "roomlist.h"
+#include "server.h"
 
 
 static GaimRoomlistUiOps *ops = NULL;
@@ -139,10 +140,19 @@
 {
 	g_return_if_fail(list != NULL);
 
+	list->in_progress = in_progress;
+
 	if (ops && ops->in_progress)
 		ops->in_progress(list, in_progress);
 }
 
+gboolean gaim_roomlist_get_in_progress(GaimRoomlist *list)
+{
+	g_return_val_if_fail(list != NULL, FALSE);
+
+	return list->in_progress;
+}
+
 void gaim_roomlist_room_add(GaimRoomlist *list, GaimRoomlistRoom *room)
 {
 	g_return_if_fail(list != NULL);
@@ -267,6 +277,33 @@
 	}
 }
 
+void gaim_roomlist_room_join(GaimRoomlist *list, GaimRoomlistRoom *room)
+{
+	GHashTable *components;
+	GList *l, *j;
+	GaimConnection *gc;
+
+	g_return_if_fail(list != NULL);
+	g_return_if_fail(room != NULL);
+
+	gc = gaim_account_get_connection(list->account);
+	if (!gc)
+		return;
+
+	components = g_hash_table_new(g_str_hash, g_str_equal);
+
+	g_hash_table_replace(components, "name", room->name);
+	for (l = list->fields, j = room->fields; l && j; l = l->next, j = j->next) {
+		GaimRoomlistField *f = l->data;
+
+		g_hash_table_replace(components, f->name, j->data);
+	}
+
+	serv_join_chat(gc, components);
+
+	g_hash_table_destroy(components);
+}
+
 /*@}*/
 
 /**************************************************************************/