# HG changeset patch
# Node ID 4af19bc115a1
# Parent  1b6374960c08
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -566,8 +566,15 @@
 		  purple_request_field_choice_add_full instead
 		* purple_request_field_list_add
 		* purple_request_field_list_get_icons
-		* purple_roomlist_get_protocol_data and
-		  purple_roomlist_set_protocol_data
+		* PurpleRoomlistRoomType
+		* purple_roomlist_expand_category
+		* purple_roomlist_field_get_field_type
+		* purple_roomlist_field_get_hidden
+		* purple_roomlist_field_get_label
+		* purple_roomlist_field_new
+		* purple_roomlist_get_fields
+		* purple_roomlist_get_protocol_data
+		* purple_roomlist_set_protocol_data
 		* PurpleSetPublicAliasFailureCallback
 		* PurpleSetPublicAliasSuccessCallback
 		* purple_smiley_get_type
diff --git a/finch/gntroomlist.c b/finch/gntroomlist.c
--- a/finch/gntroomlist.c
+++ b/finch/gntroomlist.c
@@ -117,74 +117,23 @@
 	if (!room)
 		return;
 
-	switch (purple_roomlist_room_get_room_type(room)) {
-		case PURPLE_ROOMLIST_ROOMTYPE_ROOM:
-			purple_roomlist_room_join(froomlist.roomlist, room);
-			break;
-		case PURPLE_ROOMLIST_ROOMTYPE_CATEGORY:
-			if (!purple_roomlist_room_get_expanded_once(room)) {
-				purple_roomlist_expand_category(froomlist.roomlist, room);
-				purple_roomlist_room_set_expanded_once(room, TRUE);
-			}
-			break;
-	}
-	gnt_tree_set_expanded(GNT_TREE(widget), room, TRUE);
+	purple_roomlist_join_room(froomlist.roomlist, room);
 }
 
 static void
 roomlist_selection_changed(GntWidget *widget, gpointer old, gpointer current, gpointer null)
 {
-	GList *iter, *field;
 	PurpleRoomlistRoom *room = current;
 	GntTextView *tv = GNT_TEXT_VIEW(froomlist.details);
-	gboolean first = TRUE;
 
 	gnt_text_view_clear(tv);
 
 	if (!room)
 		return;
 
-	for (iter = purple_roomlist_room_get_fields(room),
-			field = purple_roomlist_get_fields(froomlist.roomlist);
-			iter && field;
-			iter = iter->next, field = field->next) {
-		PurpleRoomlistField *f = field->data;
-		char *label = NULL;
-
-		if (purple_roomlist_field_get_hidden(f)) {
-			continue;
-		}
-
-		if (!first)
-			gnt_text_view_append_text_with_flags(tv, "\n", GNT_TEXT_FLAG_NORMAL);
-
-		gnt_text_view_append_text_with_flags(tv,
-				purple_roomlist_field_get_label(f), GNT_TEXT_FLAG_BOLD);
-		gnt_text_view_append_text_with_flags(tv, ": ", GNT_TEXT_FLAG_BOLD);
-
-		switch (purple_roomlist_field_get_field_type(f)) {
-			case PURPLE_ROOMLIST_FIELD_BOOL:
-				label = g_strdup(iter->data ? "True" : "False");
-				break;
-			case PURPLE_ROOMLIST_FIELD_INT:
-				label = g_strdup_printf("%d", GPOINTER_TO_INT(iter->data));
-				break;
-			case PURPLE_ROOMLIST_FIELD_STRING:
-				label = g_strdup(iter->data);
-				break;
-		}
-		gnt_text_view_append_text_with_flags(tv, label, GNT_TEXT_FLAG_NORMAL);
-		g_free(label);
-		first = FALSE;
-	}
-
-	if (purple_roomlist_room_get_room_type(room) == PURPLE_ROOMLIST_ROOMTYPE_CATEGORY) {
-		if (!first)
-			gnt_text_view_append_text_with_flags(tv, "\n", GNT_TEXT_FLAG_NORMAL);
-		gnt_text_view_append_text_with_flags(tv,
-				_("Hit 'Enter' to find more rooms of this category."),
-				GNT_TEXT_FLAG_NORMAL);
-	}
+	gnt_text_view_append_text_with_flags(tv,
+	                                     purple_roomlist_room_get_name(room),
+	                                     GNT_TEXT_FLAG_BOLD);
 }
 
 static void
@@ -347,18 +296,16 @@
 static void
 fl_add_room(PurpleRoomlist *roomlist, PurpleRoomlistRoom *room)
 {
-	gboolean category;
+	gchar *category = NULL;
 	if (froomlist.roomlist != roomlist)
 		return;
 
-	category = (purple_roomlist_room_get_room_type(room) == PURPLE_ROOMLIST_ROOMTYPE_CATEGORY);
 	gnt_tree_remove(GNT_TREE(froomlist.tree), room);
 	gnt_tree_add_row_after(GNT_TREE(froomlist.tree), room,
 			gnt_tree_create_row(GNT_TREE(froomlist.tree),
-				purple_roomlist_room_get_name(room),
-				category ? "<" : ""),
-			purple_roomlist_room_get_parent(room), NULL);
-	gnt_tree_set_expanded(GNT_TREE(froomlist.tree), room, !category);
+				purple_roomlist_room_get_name(room), ""),
+		NULL, NULL);
+	gnt_tree_set_expanded(GNT_TREE(froomlist.tree), room, category == NULL);
 }
 
 static PurpleRoomlistUiOps ui_ops =
diff --git a/libpurple/meson.build b/libpurple/meson.build
--- a/libpurple/meson.build
+++ b/libpurple/meson.build
@@ -73,6 +73,7 @@
 	'purpleprotocolprivacy.c',
 	'purpleprotocolroomlist.c',
 	'purpleprotocolserver.c',
+	'purpleroomlistroom.c',
 	'purplesqlitehistoryadapter.c',
 	'purpleuiinfo.c',
 	'purplewhiteboard.c',
@@ -166,6 +167,7 @@
 	'purpleprotocolprivacy.h',
 	'purpleprotocolroomlist.h',
 	'purpleprotocolserver.h',
+	'purpleroomlistroom.h',
 	'purplesqlitehistoryadapter.h',
 	'purpleuiinfo.h',
 	'purplewhiteboard.h',
diff --git a/libpurple/protocols/facebook/facebook.c b/libpurple/protocols/facebook/facebook.c
--- a/libpurple/protocols/facebook/facebook.c
+++ b/libpurple/protocols/facebook/facebook.c
@@ -793,11 +793,11 @@
 			g_string_append(gstr, alias);
 		}
 
-		room = purple_roomlist_room_new(PURPLE_ROOMLIST_ROOMTYPE_ROOM,
-		                                tid, NULL);
-		purple_roomlist_room_add_field(list, room, thrd->topic);
-		purple_roomlist_room_add_field(list, room, gstr->str);
+		room = purple_roomlist_room_new(tid, thrd->topic);
+		purple_roomlist_room_add_field(room, "topic", g_strdup(thrd->topic));
+		purple_roomlist_room_add_field(room, "users", g_strdup(gstr->str));
 		purple_roomlist_room_add(list, room);
+		g_object_unref(room);
 	}
 
 	purple_roomlist_set_in_progress(list, FALSE);
@@ -1472,10 +1472,8 @@
 {
 	FbApi *api;
 	FbData *fata;
-	GList *flds = NULL;
 	PurpleAccount *acct;
 	PurpleRoomlist *list;
-	PurpleRoomlistField *fld;
 
 	fata = purple_connection_get_protocol_data(gc);
 	list = fb_data_get_roomlist(fata);
@@ -1486,17 +1484,6 @@
 	list = purple_roomlist_new(acct);
 	fb_data_set_roomlist(fata, list);
 
-	fld = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING,
-	                                _("Topic"), "topic", FALSE);
-	flds = g_list_prepend(flds, fld);
-
-	fld = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING,
-	                                _("Users"), "users", FALSE);
-	flds = g_list_prepend(flds, fld);
-
-	flds = g_list_reverse(flds);
-	purple_roomlist_set_fields(list, flds);
-
 	purple_roomlist_set_in_progress(list, TRUE);
 	fb_api_threads(api);
 	return list;
diff --git a/libpurple/protocols/gg/chat.c b/libpurple/protocols/gg/chat.c
--- a/libpurple/protocols/gg/chat.c
+++ b/libpurple/protocols/gg/chat.c
@@ -576,31 +576,12 @@
 {
 	ggp_chat_session_data *sdata = ggp_chat_get_sdata(gc);
 	PurpleRoomlist *roomlist;
-	GList *fields = NULL;
 	int i;
 
 	purple_debug_info("gg", "ggp_chat_roomlist_get_list\n");
 
 	roomlist = purple_roomlist_new(purple_connection_get_account(gc));
 
-	fields = g_list_append(fields, purple_roomlist_field_new(
-		PURPLE_ROOMLIST_FIELD_STRING, _("Conference identifier"), "id",
-		TRUE));
-
-	fields = g_list_append(fields, purple_roomlist_field_new(
-		PURPLE_ROOMLIST_FIELD_STRING, _("Start Date"), "date",
-		FALSE));
-
-	fields = g_list_append(fields, purple_roomlist_field_new(
-		PURPLE_ROOMLIST_FIELD_INT, _("User Count"), "users",
-		FALSE));
-
-	fields = g_list_append(fields, purple_roomlist_field_new(
-		PURPLE_ROOMLIST_FIELD_STRING, _("Status"), "status",
-		FALSE));
-
-	purple_roomlist_set_fields(roomlist, fields);
-
 	for (i = sdata->chats_count - 1; i >= 0 ; i--) {
 		PurpleRoomlistRoom *room;
 		ggp_chat_local_info *chat = &sdata->chats[i];
@@ -625,13 +606,14 @@
 		}
 
 		name = ggp_chat_get_name_from_id(chat->id);
-		room = purple_roomlist_room_new(PURPLE_ROOMLIST_ROOMTYPE_ROOM,
-			name, NULL);
-		purple_roomlist_room_add_field(roomlist, room, name);
-		purple_roomlist_room_add_field(roomlist, room, purple_date_format_full(localtime(&date)));
-		purple_roomlist_room_add_field(roomlist, room, GINT_TO_POINTER(count));
-		purple_roomlist_room_add_field(roomlist, room, status);
+		room = purple_roomlist_room_new(name, NULL);
+		purple_roomlist_room_set_user_count(room, (guint)count);
+		purple_roomlist_room_add_field(room, "id", g_strdup(name));
+		purple_roomlist_room_add_field(room, "date",
+		                               g_strdup(purple_date_format_full(localtime(&date))));
+		purple_roomlist_room_add_field(room, "status", g_strdup(status));
 		purple_roomlist_room_add(roomlist, room);
+		g_object_unref(room);
 	}
 
 	/* TODO
diff --git a/libpurple/protocols/irc/irc.c b/libpurple/protocols/irc/irc.c
--- a/libpurple/protocols/irc/irc.c
+++ b/libpurple/protocols/irc/irc.c
@@ -989,8 +989,6 @@
                       PurpleConnection *gc)
 {
 	struct irc_conn *irc;
-	GList *fields = NULL;
-	PurpleRoomlistField *f;
 	char *buf;
 
 	irc = purple_connection_get_protocol_data(gc);
@@ -1000,17 +998,6 @@
 
 	irc->roomlist = purple_roomlist_new(purple_connection_get_account(gc));
 
-	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, "", "channel", TRUE);
-	fields = g_list_append(fields, f);
-
-	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_INT, _("Users"), "users", FALSE);
-	fields = g_list_append(fields, f);
-
-	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, _("Topic"), "topic", FALSE);
-	fields = g_list_append(fields, f);
-
-	purple_roomlist_set_fields(irc->roomlist, fields);
-
 	buf = irc_format(irc, "v", "LIST");
 	irc_send(irc, buf);
 	g_free(buf);
diff --git a/libpurple/protocols/irc/msgs.c b/libpurple/protocols/irc/msgs.c
--- a/libpurple/protocols/irc/msgs.c
+++ b/libpurple/protocols/irc/msgs.c
@@ -554,13 +554,14 @@
 			purple_roomlist_set_in_progress(irc->roomlist, TRUE);
 		}
 
-		room = purple_roomlist_room_new(PURPLE_ROOMLIST_ROOMTYPE_ROOM, args[1], NULL);
-		purple_roomlist_room_add_field(irc->roomlist, room, args[1]);
-		purple_roomlist_room_add_field(irc->roomlist, room, GINT_TO_POINTER(strtol(args[2], NULL, 10)));
 		topic = irc_mirc2txt(args[3]);
-		purple_roomlist_room_add_field(irc->roomlist, room, topic);
+		room = purple_roomlist_room_new(args[1], topic);
 		g_free(topic);
+
+		purple_roomlist_room_set_user_count(room, strtol(args[2], NULL, 10));
+		purple_roomlist_room_add_field(room, "channel", args[1]);
 		purple_roomlist_room_add(irc->roomlist, room);
+		g_object_unref(room);
 	}
 }
 
diff --git a/libpurple/protocols/jabber/chat.c b/libpurple/protocols/jabber/chat.c
--- a/libpurple/protocols/jabber/chat.c
+++ b/libpurple/protocols/jabber/chat.c
@@ -802,11 +802,11 @@
 		name = purple_xmlnode_get_attrib(item, "name");
 
 
-		room = purple_roomlist_room_new(PURPLE_ROOMLIST_ROOMTYPE_ROOM, jid->node, NULL);
-		purple_roomlist_room_add_field(js->roomlist, room, jid->node);
-		purple_roomlist_room_add_field(js->roomlist, room, jid->domain);
-		purple_roomlist_room_add_field(js->roomlist, room, name ? name : "");
+		room = purple_roomlist_room_new(jid->node, name);
+		purple_roomlist_room_add_field(room, "room", g_strdup(jid->node));
+		purple_roomlist_room_add_field(room, "server", g_strdup(jid->domain));
 		purple_roomlist_room_add(js->roomlist, room);
+		g_object_unref(room);
 
 		jabber_id_free(jid);
 	}
@@ -854,26 +854,12 @@
                          PurpleConnection *gc)
 {
 	JabberStream *js = purple_connection_get_protocol_data(gc);
-	GList *fields = NULL;
-	PurpleRoomlistField *f;
 
 	if(js->roomlist)
 		g_object_unref(js->roomlist);
 
 	js->roomlist = purple_roomlist_new(purple_connection_get_account(js->gc));
 
-	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, "", "room", TRUE);
-	fields = g_list_append(fields, f);
-
-	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, "", "server", TRUE);
-	fields = g_list_append(fields, f);
-
-	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, _("Description"), "description", FALSE);
-	fields = g_list_append(fields, f);
-
-	purple_roomlist_set_fields(js->roomlist, fields);
-
-
 	purple_request_input(gc, _("Enter a Conference Server"), _("Enter a Conference Server"),
 			_("Select a conference server to query"),
 			js->chat_servers ? js->chat_servers->data : NULL,
@@ -910,8 +896,12 @@
 jabber_roomlist_room_serialize(PurpleProtocolRoomlist *protocol_roomlist,
                                PurpleRoomlistRoom *room)
 {
-	GList *fields = purple_roomlist_room_get_fields(room);
-	return g_strdup_printf("%s@%s", (char*)fields->data, (char*)fields->next->data);
+	const gchar *room_name = NULL, *server = NULL;
+
+	room_name = purple_roomlist_room_get_field(room, "room");
+	server = purple_roomlist_room_get_field(room, "server");
+
+	return g_strdup_printf("%s@%s", room_name, server);
 }
 
 void jabber_chat_member_free(JabberChatMember *jcm)
diff --git a/libpurple/protocols/null/nullprpl.c b/libpurple/protocols/null/nullprpl.c
--- a/libpurple/protocols/null/nullprpl.c
+++ b/libpurple/protocols/null/nullprpl.c
@@ -1081,23 +1081,11 @@
   const char *username = purple_account_get_username(purple_connection_get_account(gc));
   PurpleConversationManager *manager;
   PurpleRoomlist *roomlist = purple_roomlist_new(purple_connection_get_account(gc));
-  GList *fields = NULL;
-  PurpleRoomlistField *field;
   GList *chats;
   GList *seen_ids = NULL;
 
   purple_debug_info("nullprpl", "%s asks for room list; returning:\n", username);
 
-  /* set up the room list */
-  field = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, "room",
-                                    "room", TRUE /* hidden */);
-  fields = g_list_append(fields, field);
-
-  field = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_INT, "Id", "Id", FALSE);
-  fields = g_list_append(fields, field);
-
-  purple_roomlist_set_fields(roomlist, fields);
-
   manager = purple_conversation_manager_get_default();
 
   /* add each chat room. the chat ids are cached in seen_ids so that each room
@@ -1126,10 +1114,10 @@
     seen_ids = g_list_prepend(seen_ids, (char *)name); /* no, it's new. */
     purple_debug_info("nullprpl", "%s (%d), ", name, id);
 
-    room = purple_roomlist_room_new(PURPLE_ROOMLIST_ROOMTYPE_ROOM, name, NULL);
-    purple_roomlist_room_add_field(roomlist, room, name);
-    purple_roomlist_room_add_field(roomlist, room, &id);
+    room = purple_roomlist_room_new(name, NULL);
+    purple_roomlist_room_add_field(room, "room", g_strdup(name));
     purple_roomlist_room_add(roomlist, room);
+    g_object_unref(room);
   }
 
   g_list_free(seen_ids);
diff --git a/libpurple/protocols/silc/chat.c b/libpurple/protocols/silc/chat.c
--- a/libpurple/protocols/silc/chat.c
+++ b/libpurple/protocols/silc/chat.c
@@ -1336,8 +1336,6 @@
 	SilcPurple sg = purple_connection_get_protocol_data(gc);
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
-	GList *fields = NULL;
-	PurpleRoomlistField *f;
 
 	if (!conn)
 		return NULL;
@@ -1348,15 +1346,6 @@
 	sg->roomlist_cancelled = FALSE;
 
 	sg->roomlist = purple_roomlist_new(purple_connection_get_account(gc));
-	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, "", "channel", TRUE);
-	fields = g_list_append(fields, f);
-	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_INT,
-				    _("Users"), "users", FALSE);
-	fields = g_list_append(fields, f);
-	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING,
-				    _("Topic"), "topic", FALSE);
-	fields = g_list_append(fields, f);
-	purple_roomlist_set_fields(sg->roomlist, fields);
 
 	/* Call LIST */
 	silc_client_command_call(client, conn, "LIST");
diff --git a/libpurple/protocols/silc/ops.c b/libpurple/protocols/silc/ops.c
--- a/libpurple/protocols/silc/ops.c
+++ b/libpurple/protocols/silc/ops.c
@@ -1443,13 +1443,11 @@
 			topic = va_arg(ap, char *);
 			usercount = va_arg(ap, int);
 
-			room = purple_roomlist_room_new(PURPLE_ROOMLIST_ROOMTYPE_ROOM, name, NULL);
-			purple_roomlist_room_add_field(sg->roomlist, room, name);
-			purple_roomlist_room_add_field(sg->roomlist, room,
-						       SILC_32_TO_PTR(usercount));
-			purple_roomlist_room_add_field(sg->roomlist, room,
-						       topic ? topic : "");
+			room = purple_roomlist_room_new(name, topic);
+			purple_roomlist_room_set_user_count(room, usercount);
+			purple_roomlist_room_add_field(room, "channel", g_strdup(name));
 			purple_roomlist_room_add(sg->roomlist, room);
+			g_object_unref(room);
 
 			if (status == SILC_STATUS_LIST_END ||
 			    status == SILC_STATUS_OK) {
diff --git a/libpurple/purpleroomlistroom.h b/libpurple/purpleroomlistroom.h
new file mode 100644
--- /dev/null
+++ b/libpurple/purpleroomlistroom.h
@@ -0,0 +1,183 @@
+/*
+ * Purple - Internet Messaging Library
+ * Copyright (C) Pidgin Developers <devel@pidgin.im>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
+# error "only <purple.h> may be included directly"
+#endif
+
+#ifndef PURPLE_ROOMLIST_ROOM_H
+#define PURPLE_ROOMLIST_ROOM_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define PURPLE_TYPE_ROOMLIST_ROOM (purple_roomlist_room_get_type())
+
+/**
+ * purple_roomlist_room_get_type:
+ *
+ * Gets the #GType of #PurpleRoomlistRoom.
+ *
+ * Returns: The #GType of #PurpleRoomlistRoom.
+ *
+ * Since: 3.0.0
+ */
+
+/**
+ * PurpleRoomlistRoom:
+ *
+ * #PurpleRoomlistRoom keeps track of all #PurpleConversation's inside
+ * of libpurple and allows searching of them.
+ *
+ * Since: 3.0.0
+ */
+G_DECLARE_DERIVABLE_TYPE(PurpleRoomlistRoom, purple_roomlist_room, PURPLE,
+						 ROOMLIST_ROOM, GObject)
+
+struct _PurpleRoomlistRoomClass {
+	/*< private >*/
+	GObjectClass parent;
+
+	gpointer reserved[4];
+};
+
+/**
+ * purple_roomlist_room_new:
+ * @name: The name for the room.
+ * @description: The description or topic of the room.
+ *
+ * Creates a new room to be added to a [class@Purple.Roomlist].
+ *
+ * Since: 3.0.0
+ */
+PurpleRoomlistRoom *purple_roomlist_room_new(const gchar *name, const gchar *description);
+
+/**
+ * purple_roomlist_room_get_name:
+ * @room: The instance.
+ *
+ * Gets the name of @room.
+ *
+ * Returns: The name of @room.
+ *
+ * Since: 3.0.0
+ */
+const gchar *purple_roomlist_room_get_name(PurpleRoomlistRoom *room);
+
+/**
+ * purple_roomlist_room_get_description:
+ * @room: The instance.
+ *
+ * Gets the description of @room.
+ *
+ * Returns: The description of @room.
+ *
+ * Since: 3.0.0
+ */
+const gchar *purple_roomlist_room_get_description(PurpleRoomlistRoom *room);
+
+/**
+ * purple_roomlist_get_category:
+ * @room: The instance.
+ *
+ * Gets the category of @room. It is up to the user interface on whether or not
+ * this will be used.
+ *
+ * Returns: The category of @room if set otherwise %NULL.
+ *
+ * Since: 3.0.0
+ */
+const gchar *purple_roomlist_room_get_category(PurpleRoomlistRoom *room);
+
+/**
+ * purple_roomlist_room_set_category:
+ * @room: The instance.
+ * @category: (nullable): The new category.
+ *
+ * Sets the category of @room.
+ *
+ * Since: 3.0.0
+ */
+void purple_roomlist_room_set_category(PurpleRoomlistRoom *room, const gchar *category);
+
+/**
+ * purple_roomlist_room_get_user_count:
+ * @room: The instance.
+ *
+ * Gets the number of users in @room.
+ *
+ * Returns: The number of users in @room if set, otherwise 0.
+ *
+ * Since: 3.0.0
+ */
+const guint purple_roomlist_room_get_user_count(PurpleRoomlistRoom *room);
+
+/**
+ * purple_roomlist_room_set_user_count:
+ * @room: The instance.
+ * @user_count: The new user count.
+ *
+ * Sets the user count of @room to @user_count.
+ *
+ * Since: 3.0.0
+ */
+void purple_roomlist_room_set_user_count(PurpleRoomlistRoom *room, guint user_count);
+
+/**
+ * purple_roomlist_room_add_field:
+ * @room: This instance.
+ * @field: The name of the field. This should be a static string.
+ * @value: The value of the field. This should be a copy of the value.
+ *
+ * Adds a new field to @room with the name of @field and value of @value.
+ *
+ * Since: 3.0.0
+ */
+void purple_roomlist_room_add_field(PurpleRoomlistRoom *room, const gchar *field, const gchar *value);
+
+/**
+ * purple_roomlist_room_get_field:
+ * @room: The instance.
+ * @field: The name of the field to get.
+ *
+ * Gets the value of the field named @field in @room.
+ *
+ * Returns: The value of @field.
+ *
+ * Since: 3.0.0
+ */
+const gchar *purple_roomlist_room_get_field(PurpleRoomlistRoom *room, const gchar *field);
+
+/**
+ * purple_roomlist_room_get_components:
+ * @room: The instance.
+ *
+ * Gets the components that can be passed to purple_serv_join_chat() to join
+ * the room.
+ *
+ * Returns: (transfer none): The components used to join the room.
+ *
+ * Since: 3.0.0
+ */
+GHashTable *purple_roomlist_room_get_components(PurpleRoomlistRoom *room);
+
+G_END_DECLS
+
+#endif /* PURPLE_ROOMLIST_ROOM_H */
diff --git a/libpurple/purpleroomlistroom.c b/libpurple/purpleroomlistroom.c
new file mode 100644
--- /dev/null
+++ b/libpurple/purpleroomlistroom.c
@@ -0,0 +1,316 @@
+/*
+ * Purple - Internet Messaging Library
+ * Copyright (C) Pidgin Developers <devel@pidgin.im>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include "purpleroomlistroom.h"
+
+typedef struct {
+	gchar *name;
+	gchar *description;
+	gchar *category;
+	guint user_count;
+
+	GHashTable *components;
+} PurpleRoomlistRoomPrivate;
+
+enum {
+	PROP_0,
+	PROP_NAME,
+	PROP_DESCRIPTION,
+	PROP_CATEGORY,
+	PROP_USER_COUNT,
+	N_PROPERTIES
+};
+static GParamSpec *properties[N_PROPERTIES] = {NULL, };
+
+G_DEFINE_TYPE_WITH_PRIVATE(PurpleRoomlistRoom, purple_roomlist_room,
+                           G_TYPE_OBJECT)
+
+/******************************************************************************
+ * Helpers
+ *****************************************************************************/
+static void
+purple_roomlist_room_set_name(PurpleRoomlistRoom *room, const gchar *name) {
+	PurpleRoomlistRoomPrivate *priv = NULL;
+
+	g_return_if_fail(PURPLE_IS_ROOMLIST_ROOM(room));
+
+	priv = purple_roomlist_room_get_instance_private(room);
+
+	g_clear_pointer(&priv->name, g_free);
+	priv->name = g_strdup(name);
+
+	g_object_notify_by_pspec(G_OBJECT(room), properties[PROP_NAME]);
+}
+
+static void
+purple_roomlist_room_set_description(PurpleRoomlistRoom *room,
+                                     const gchar *description)
+{
+	PurpleRoomlistRoomPrivate *priv = NULL;
+
+	g_return_if_fail(PURPLE_IS_ROOMLIST_ROOM(room));
+
+	priv = purple_roomlist_room_get_instance_private(room);
+
+	g_clear_pointer(&priv->description, g_free);
+	priv->description = g_strdup(description);
+
+	g_object_notify_by_pspec(G_OBJECT(room), properties[PROP_DESCRIPTION]);
+}
+
+/******************************************************************************
+ * GObject Implementation
+ *****************************************************************************/
+static void
+purple_roomlist_room_get_property(GObject *obj, guint param_id, GValue *value,
+                                  GParamSpec *pspec)
+{
+	PurpleRoomlistRoom *room = PURPLE_ROOMLIST_ROOM(obj);
+
+	switch(param_id) {
+		case PROP_NAME:
+			g_value_set_string(value, purple_roomlist_room_get_name(room));
+			break;
+		case PROP_DESCRIPTION:
+			g_value_set_string(value,
+			                   purple_roomlist_room_get_description(room));
+			break;
+		case PROP_CATEGORY:
+			g_value_set_string(value, purple_roomlist_room_get_category(room));
+			break;
+		case PROP_USER_COUNT:
+			g_value_set_uint(value, purple_roomlist_room_get_user_count(room));
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
+			break;
+	}
+}
+
+static void
+purple_roomlist_room_set_property(GObject *obj, guint param_id,
+                                  const GValue *value, GParamSpec *pspec)
+{
+	PurpleRoomlistRoom *room = PURPLE_ROOMLIST_ROOM(obj);
+
+	switch(param_id) {
+		case PROP_NAME:
+			purple_roomlist_room_set_name(room, g_value_get_string(value));
+			break;
+		case PROP_DESCRIPTION:
+			purple_roomlist_room_set_description(room,
+			                                     g_value_get_string(value));
+			break;
+		case PROP_CATEGORY:
+			purple_roomlist_room_set_category(room, g_value_get_string(value));
+			break;
+		case PROP_USER_COUNT:
+			purple_roomlist_room_set_user_count(room, g_value_get_uint(value));
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
+			break;
+	}
+}
+
+static void
+purple_roomlist_room_finalize(GObject *obj) {
+	PurpleRoomlistRoom *room = NULL;
+	PurpleRoomlistRoomPrivate *priv = NULL;;
+
+	room = PURPLE_ROOMLIST_ROOM(obj);
+	priv = purple_roomlist_room_get_instance_private(room);
+
+	g_clear_pointer(&priv->name, g_free);
+	g_clear_pointer(&priv->description, g_free);
+	g_clear_pointer(&priv->category, g_free);
+
+	g_clear_pointer(&priv->components, g_hash_table_destroy);
+
+	G_OBJECT_CLASS(purple_roomlist_room_parent_class)->finalize(obj);
+}
+
+static void
+purple_roomlist_room_init(PurpleRoomlistRoom *room) {
+	PurpleRoomlistRoomPrivate *priv = NULL;
+
+	priv = purple_roomlist_room_get_instance_private(room);
+
+	priv->components = g_hash_table_new_full(g_str_hash, g_str_equal, NULL,
+	                                         g_free);
+}
+
+static void
+purple_roomlist_room_class_init(PurpleRoomlistRoomClass *klass) {
+	GObjectClass *obj_class = G_OBJECT_CLASS(klass);
+
+	obj_class->get_property = purple_roomlist_room_get_property;
+	obj_class->set_property = purple_roomlist_room_set_property;
+	obj_class->finalize = purple_roomlist_room_finalize;
+
+	properties[PROP_NAME] = g_param_spec_string(
+		"name", "name",
+		"The name of the room",
+		NULL,
+		G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+
+	properties[PROP_DESCRIPTION] = g_param_spec_string(
+		"description", "description",
+		"The description of the room",
+		NULL,
+		G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+
+	properties[PROP_CATEGORY] = g_param_spec_string(
+		"category", "category",
+		"The category of the room",
+		NULL,
+		G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+
+	properties[PROP_USER_COUNT] = g_param_spec_uint(
+		"user-count", "user-count",
+		"The user count of the room",
+		0, G_MAXUINT, 0,
+		G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+
+	g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
+}
+
+/******************************************************************************
+ * Public API
+ *****************************************************************************/
+PurpleRoomlistRoom *
+purple_roomlist_room_new(const gchar *name, const gchar *description) {
+	return g_object_new(
+		PURPLE_TYPE_ROOMLIST_ROOM,
+		"name", name,
+		"description", description,
+		NULL);
+}
+
+const gchar *
+purple_roomlist_room_get_name(PurpleRoomlistRoom *room) {
+	PurpleRoomlistRoomPrivate *priv = NULL;
+
+	g_return_val_if_fail(PURPLE_IS_ROOMLIST_ROOM(room), NULL);
+
+	priv = purple_roomlist_room_get_instance_private(room);
+
+	return priv->name;
+}
+
+const gchar *
+purple_roomlist_room_get_description(PurpleRoomlistRoom *room) {
+	PurpleRoomlistRoomPrivate *priv = NULL;
+
+	g_return_val_if_fail(PURPLE_IS_ROOMLIST_ROOM(room), NULL);
+
+	priv = purple_roomlist_room_get_instance_private(room);
+
+	return priv->description;
+}
+
+const gchar *
+purple_roomlist_room_get_category(PurpleRoomlistRoom *room) {
+	PurpleRoomlistRoomPrivate *priv = NULL;
+
+	g_return_val_if_fail(PURPLE_IS_ROOMLIST_ROOM(room), NULL);
+
+	priv = purple_roomlist_room_get_instance_private(room);
+
+	return priv->category;
+}
+
+void
+purple_roomlist_room_set_category(PurpleRoomlistRoom *room,
+                                  const gchar *category)
+{
+	PurpleRoomlistRoomPrivate *priv = NULL;
+
+	g_return_if_fail(PURPLE_IS_ROOMLIST_ROOM(room));
+
+	priv = purple_roomlist_room_get_instance_private(room);
+
+	g_clear_pointer(&priv->category, g_free);
+	priv->category = g_strdup(category);
+
+	g_object_notify_by_pspec(G_OBJECT(room), properties[PROP_CATEGORY]);
+}
+
+const guint
+purple_roomlist_room_get_user_count(PurpleRoomlistRoom *room) {
+	PurpleRoomlistRoomPrivate *priv = NULL;
+
+	g_return_val_if_fail(PURPLE_IS_ROOMLIST_ROOM(room), 0);
+
+	priv = purple_roomlist_room_get_instance_private(room);
+
+	return priv->user_count;
+}
+
+void
+purple_roomlist_room_set_user_count(PurpleRoomlistRoom *room,
+                                    guint user_count)
+{
+	PurpleRoomlistRoomPrivate *priv = NULL;
+
+	g_return_if_fail(PURPLE_IS_ROOMLIST_ROOM(room));
+
+	priv = purple_roomlist_room_get_instance_private(room);
+
+	priv->user_count = user_count;
+
+	g_object_notify_by_pspec(G_OBJECT(room), properties[PROP_USER_COUNT]);
+}
+
+void
+purple_roomlist_room_add_field(PurpleRoomlistRoom *room, const gchar *field,
+                               const gchar *value)
+{
+	PurpleRoomlistRoomPrivate *priv = NULL;
+
+	g_return_if_fail(PURPLE_IS_ROOMLIST_ROOM(room));
+	g_return_if_fail(field != NULL);
+	g_return_if_fail(value != NULL);
+
+	priv = purple_roomlist_room_get_instance_private(room);
+
+	g_hash_table_replace(priv->components, field, g_strdup(value));
+}
+
+const gchar *
+purple_roomlist_room_get_field(PurpleRoomlistRoom *room, const gchar *field) {
+	PurpleRoomlistRoomPrivate *priv = NULL;
+
+	g_return_val_if_fail(PURPLE_IS_ROOMLIST_ROOM(room), NULL);
+	g_return_val_if_fail(field != NULL, NULL);
+
+	priv = purple_roomlist_room_get_instance_private(room);
+
+	return g_hash_table_lookup(priv->components, field);
+}
+
+GHashTable *
+purple_roomlist_room_get_components(PurpleRoomlistRoom *room) {
+	PurpleRoomlistRoomPrivate *priv = NULL;
+
+	g_return_val_if_fail(PURPLE_IS_ROOMLIST_ROOM(room), NULL);
+
+	priv = purple_roomlist_room_get_instance_private(room);
+
+	return priv->components;
+}
diff --git a/libpurple/roomlist.h b/libpurple/roomlist.h
--- a/libpurple/roomlist.h
+++ b/libpurple/roomlist.h
@@ -36,14 +36,6 @@
 typedef struct _PurpleRoomlist PurpleRoomlist;
 
 /**
- * PURPLE_TYPE_ROOMLIST_ROOM:
- *
- * The standard _get_type macro for #PurpleRoomlistRoom.
- */
-#define PURPLE_TYPE_ROOMLIST_ROOM (purple_roomlist_room_get_type())
-typedef struct _PurpleRoomlistRoom PurpleRoomlistRoom;
-
-/**
  * PURPLE_TYPE_ROOMLIST_FIELD:
  *
  * The standard _get_type macro for #PurpleRoomlistField.
@@ -60,23 +52,6 @@
 typedef struct _PurpleRoomlistUiOps PurpleRoomlistUiOps;
 
 /**
- * PurpleRoomlistRoomType:
- * @PURPLE_ROOMLIST_ROOMTYPE_CATEGORY: It's a category, but not a room you can
- *                                     join.
- * @PURPLE_ROOMLIST_ROOMTYPE_ROOM:     It's a room, like the kind you can join.
- *
- * The types of rooms.
- *
- * These are ORable flags.
- */
-typedef enum
-{
-	PURPLE_ROOMLIST_ROOMTYPE_CATEGORY = 0x01,
-	PURPLE_ROOMLIST_ROOMTYPE_ROOM     = 0x02
-
-} PurpleRoomlistRoomType;
-
-/**
  * PurpleRoomlistFieldType:
  * @PURPLE_ROOMLIST_FIELD_BOOL: The field is a boolean.
  * @PURPLE_ROOMLIST_FIELD_INT: The field is an integer.
@@ -95,6 +70,7 @@
 
 #include "account.h"
 #include <glib.h>
+#include "purpleroomlistroom.h"
 
 /**************************************************************************/
 /* Data Structures                                                        */
@@ -250,191 +226,15 @@
 void purple_roomlist_cancel_get_list(PurpleRoomlist *list);
 
 /**
- * purple_roomlist_expand_category:
- * @list:     The room list.
- * @category: The category that was expanded. The expression
- *                 (category->type & PURPLE_ROOMLIST_ROOMTYPE_CATEGORY)
- *                 must be true.
- *
- * Tells the protocol that a category was expanded.
- *
- * On some protocols, the rooms in the category
- * won't be fetched until this is called.
- */
-void purple_roomlist_expand_category(PurpleRoomlist *list, PurpleRoomlistRoom *category);
-
-/**
- * purple_roomlist_get_fields:
- * @roomlist: The roomlist, which must not be %NULL.
- *
- * Get the list of fields for a roomlist.
- *
- * Returns: (element-type PurpleRoomlistField) (transfer none): A list of fields
- */
-GList *purple_roomlist_get_fields(PurpleRoomlist *roomlist);
-
-/**************************************************************************/
-/* Room API                                                               */
-/**************************************************************************/
-
-/**
- * purple_roomlist_room_get_type:
- *
- * The standard _get_type function for #PurpleRoomlistRoom.
- *
- * Returns: The #GType for the #PurpleRoomlistRoom boxed structure.
- */
-GType purple_roomlist_room_get_type(void);
-
-/**
- * purple_roomlist_room_new:
- * @type: The type of room.
- * @name: The name of the room.
- * @parent: The room's parent, if any.
- *
- * Creates a new room, to be added to the list.
- *
- * Returns: A new room.
- */
-PurpleRoomlistRoom *purple_roomlist_room_new(PurpleRoomlistRoomType type, const gchar *name,
-                                         PurpleRoomlistRoom *parent);
-
-/**
- * purple_roomlist_room_add_field:
- * @list: The room list the room belongs to.
- * @room: The room.
- * @field: The field to append. Strings get g_strdup'd internally.
- *
- * Adds a field to a room.
- */
-void purple_roomlist_room_add_field(PurpleRoomlist *list, PurpleRoomlistRoom *room, gconstpointer field);
-
-/**
- * purple_roomlist_room_join:
- * @list: The room list the room belongs to.
+ * purple_roomlist_join_room:
+ * @list: The room list whose room to join.
  * @room: The room to join.
  *
- * Join a room, given a PurpleRoomlistRoom and it's associated PurpleRoomlist.
- */
-void purple_roomlist_room_join(PurpleRoomlist *list, PurpleRoomlistRoom *room);
-
-/**
- * purple_roomlist_room_get_room_type:
- * @room:  The room, which must not be %NULL.
- *
- * Get the type of a room.
- *
- * Returns: The type of the room.
- */
-PurpleRoomlistRoomType purple_roomlist_room_get_room_type(PurpleRoomlistRoom *room);
-
-/**
- * purple_roomlist_room_get_name:
- * @room:  The room, which must not be %NULL.
- *
- * Get the name of a room.
- *
- * Returns: The name of the room.
- */
-const char * purple_roomlist_room_get_name(PurpleRoomlistRoom *room);
-
-/**
- * purple_roomlist_room_get_parent:
- * @room:  The room, which must not be %NULL.
- *
- * Get the parent of a room.
+ * Create a new conversation for @room.
  *
- * Returns: The parent of the room, which can be %NULL.
- */
-PurpleRoomlistRoom * purple_roomlist_room_get_parent(PurpleRoomlistRoom *room);
-
-/**
- * purple_roomlist_room_get_expanded_once:
- * @room:  The room, which must not be %NULL.
- *
- * Get the value of the expanded_once flag.
- *
- * Returns: The value of the expanded_once flag.
- */
-gboolean purple_roomlist_room_get_expanded_once(PurpleRoomlistRoom *room);
-
-/**
- * purple_roomlist_room_set_expanded_once:
- * @room: The room, which must not be %NULL.
- * @expanded_once: The new value of the expanded_once flag.
- *
- * Set the expanded_once flag.
- */
-void purple_roomlist_room_set_expanded_once(PurpleRoomlistRoom *room, gboolean expanded_once);
-
-/**
- * purple_roomlist_room_get_fields:
- * @room:  The room, which must not be %NULL.
- *
- * Get the list of fields for a room.
- *
- * Returns: (element-type PurpleRoomlistField) (transfer none): A list of fields
+ * Since: 3.0.0
  */
-GList * purple_roomlist_room_get_fields(PurpleRoomlistRoom *room);
-
-/**************************************************************************/
-/* Room Field API                                                         */
-/**************************************************************************/
-
-/**
- * purple_roomlist_field_get_type:
- *
- * The standard _get_type function for #PurpleRoomlistField.
- *
- * Returns: The #GType for the #PurpleRoomlistField boxed structure.
- */
-GType purple_roomlist_field_get_type(void);
-
-/**
- * purple_roomlist_field_new:
- * @type:   The type of the field.
- * @label:  The i18n'ed, user displayable name.
- * @name:   The internal name of the field.
- * @hidden: Hide the field.
- *
- * Creates a new field.
- *
- * Returns: A new PurpleRoomlistField, ready to be added to a GList and passed to
- *         purple_roomlist_set_fields().
- */
-PurpleRoomlistField *purple_roomlist_field_new(PurpleRoomlistFieldType type,
-                                           const gchar *label, const gchar *name,
-                                           gboolean hidden);
-
-/**
- * purple_roomlist_field_get_field_type:
- * @field:  A PurpleRoomlistField, which must not be %NULL.
- *
- * Get the type of a field.
- *
- * Returns:  The type of the field.
- */
-PurpleRoomlistFieldType purple_roomlist_field_get_field_type(PurpleRoomlistField *field);
-
-/**
- * purple_roomlist_field_get_label:
- * @field:  A PurpleRoomlistField, which must not be %NULL.
- *
- * Get the label of a field.
- *
- * Returns:  The label of the field.
- */
-const char * purple_roomlist_field_get_label(PurpleRoomlistField *field);
-
-/**
- * purple_roomlist_field_get_hidden:
- * @field:  A PurpleRoomlistField, which must not be %NULL.
- *
- * Check whether a roomlist-field is hidden.
- *
- * Returns:  %TRUE if the field is hidden, %FALSE otherwise.
- */
-gboolean purple_roomlist_field_get_hidden(PurpleRoomlistField *field);
+void purple_roomlist_join_room(PurpleRoomlist *roomlist, PurpleRoomlistRoom *room);
 
 /**************************************************************************/
 /* UI Registration Functions                                              */
diff --git a/libpurple/roomlist.c b/libpurple/roomlist.c
--- a/libpurple/roomlist.c
+++ b/libpurple/roomlist.c
@@ -36,38 +36,15 @@
  */
 typedef struct {
 	PurpleAccount *account;  /* The account this list belongs to. */
-	GList *fields;           /* The fields.                       */
 	GList *rooms;            /* The list of rooms.                */
 	gboolean in_progress;    /* The listing is in progress.       */
 } PurpleRoomlistPrivate;
 
-/*
- * Represents a room.
- */
-struct _PurpleRoomlistRoom {
-	PurpleRoomlistRoomType type; /* The type of room. */
-	gchar *name; /* The name of the room. */
-	GList *fields; /* Other fields. */
-	PurpleRoomlistRoom *parent; /* The parent room, or NULL. */
-	gboolean expanded_once; /* A flag the UI uses to avoid multiple expand protocol cbs. */
-};
-
-/*
- * A field a room might have.
- */
-struct _PurpleRoomlistField {
-	PurpleRoomlistFieldType type; /* The type of field. */
-	gchar *label; /* The i18n user displayed name of the field. */
-	gchar *name; /* The internal name of the field. */
-	gboolean hidden; /* Hidden? */
-};
-
 /* Room list property enums */
 enum
 {
 	PROP_0,
 	PROP_ACCOUNT,
-	PROP_FIELDS,
 	PROP_IN_PROGRESS,
 	PROP_LAST
 };
@@ -77,10 +54,6 @@
 
 G_DEFINE_TYPE_WITH_PRIVATE(PurpleRoomlist, purple_roomlist, G_TYPE_OBJECT);
 
-static void purple_roomlist_room_free(PurpleRoomlistRoom *r);
-static void purple_roomlist_field_free(PurpleRoomlistField *f);
-static void purple_roomlist_room_destroy(PurpleRoomlist *list, PurpleRoomlistRoom *r);
-
 /**************************************************************************/
 /* Room List API                                                          */
 /**************************************************************************/
@@ -101,21 +74,6 @@
 	return priv->account;
 }
 
-void purple_roomlist_set_fields(PurpleRoomlist *list, GList *fields)
-{
-	PurpleRoomlistPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_ROOMLIST(list));
-
-	priv = purple_roomlist_get_instance_private(list);
-	priv->fields = fields;
-
-	if (ops && ops->set_fields)
-		ops->set_fields(list, fields);
-
-	g_object_notify_by_pspec(G_OBJECT(list), properties[PROP_FIELDS]);
-}
-
 void purple_roomlist_set_in_progress(PurpleRoomlist *list, gboolean in_progress)
 {
 	PurpleRoomlistPrivate *priv = NULL;
@@ -190,39 +148,40 @@
 	}
 }
 
-void purple_roomlist_expand_category(PurpleRoomlist *list, PurpleRoomlistRoom *category)
-{
+void
+purple_roomlist_join_room(PurpleRoomlist *roomlist, PurpleRoomlistRoom *room) {
 	PurpleRoomlistPrivate *priv = NULL;
-	PurpleProtocol *protocol = NULL;
-	PurpleConnection *gc;
+	PurpleConnection *connection = NULL;
+	GHashTable *components = NULL, *adjusted = NULL;
+	GHashTableIter iter;
+	const gchar *name = NULL;
+	gpointer key, value;
 
-	g_return_if_fail(PURPLE_IS_ROOMLIST(list));
-	g_return_if_fail(category != NULL);
-	g_return_if_fail(category->type & PURPLE_ROOMLIST_ROOMTYPE_CATEGORY);
-
-	priv = purple_roomlist_get_instance_private(list);
+	g_return_if_fail(PURPLE_IS_ROOMLIST(roomlist));
+	g_return_if_fail(PURPLE_IS_ROOMLIST_ROOM(room));
 
-	gc = purple_account_get_connection(priv->account);
-	g_return_if_fail(PURPLE_IS_CONNECTION(gc));
+	priv = purple_roomlist_get_instance_private(roomlist);
 
-	if(gc) {
-		protocol = purple_connection_get_protocol(gc);
+	connection = purple_account_get_connection(priv->account);
+	if(connection == NULL) {
+		return;
 	}
 
-	if(PURPLE_IS_PROTOCOL_ROOMLIST(protocol)) {
-		purple_protocol_roomlist_expand_category(PURPLE_PROTOCOL_ROOMLIST(protocol),
-		                                         list, category);
-	}
-}
+	components = purple_roomlist_room_get_components(room);
 
-GList * purple_roomlist_get_fields(PurpleRoomlist *list)
-{
-	PurpleRoomlistPrivate *priv = NULL;
+	/* Make a copy of the components as we make sure the name is included. */
+	adjusted = g_hash_table_new(g_str_hash, g_str_equal);
+	g_hash_table_iter_init(&iter, components);
+	while(g_hash_table_iter_next(&iter, &key, &value)) {
+		g_hash_table_insert(adjusted, key, value);
+	}
 
-	g_return_val_if_fail(PURPLE_IS_ROOMLIST(list), NULL);
+	name = purple_roomlist_room_get_name(room);
+	g_hash_table_replace(adjusted, "name", (gpointer)name);
 
-	priv = purple_roomlist_get_instance_private(list);
-	return priv->fields;
+	purple_serv_join_chat(connection, adjusted);
+
+	g_hash_table_destroy(adjusted);
 }
 
 /**************************************************************************/
@@ -242,9 +201,6 @@
 		case PROP_ACCOUNT:
 			priv->account = g_value_get_object(value);
 			break;
-		case PROP_FIELDS:
-			purple_roomlist_set_fields(list, g_value_get_pointer(value));
-			break;
 		case PROP_IN_PROGRESS:
 			purple_roomlist_set_in_progress(list, g_value_get_boolean(value));
 			break;
@@ -265,9 +221,6 @@
 		case PROP_ACCOUNT:
 			g_value_set_object(value, purple_roomlist_get_account(list));
 			break;
-		case PROP_FIELDS:
-			g_value_set_pointer(value, purple_roomlist_get_fields(list));
-			break;
 		case PROP_IN_PROGRESS:
 			g_value_set_boolean(value, purple_roomlist_get_in_progress(list));
 			break;
@@ -301,17 +254,10 @@
 	PurpleRoomlist *list = PURPLE_ROOMLIST(object);
 	PurpleRoomlistPrivate *priv =
 			purple_roomlist_get_instance_private(list);
-	GList *l;
 
 	purple_debug_misc("roomlist", "destroying list %p\n", list);
 
-	for (l = priv->rooms; l; l = l->next) {
-		PurpleRoomlistRoom *r = l->data;
-		purple_roomlist_room_destroy(list, r);
-	}
-	g_list_free(priv->rooms);
-
-	g_list_free_full(priv->fields, (GDestroyNotify)purple_roomlist_field_free);
+	g_list_free_full(priv->rooms, g_object_unref);
 
 	G_OBJECT_CLASS(purple_roomlist_parent_class)->finalize(object);
 }
@@ -335,10 +281,6 @@
 				G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
 				G_PARAM_STATIC_STRINGS);
 
-	properties[PROP_FIELDS] = g_param_spec_pointer("fields", "Fields",
-				"The list of fields for a roomlist.",
-				G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
 	properties[PROP_IN_PROGRESS] = g_param_spec_boolean("in-progress",
 				"In progress",
 				"Whether the room list is being fetched.", FALSE,
@@ -356,244 +298,6 @@
 }
 
 /**************************************************************************/
-/* Room API                                                               */
-/**************************************************************************/
-
-PurpleRoomlistRoom *purple_roomlist_room_new(PurpleRoomlistRoomType type, const gchar *name,
-                                         PurpleRoomlistRoom *parent)
-{
-	PurpleRoomlistRoom *room;
-
-	g_return_val_if_fail(name != NULL, NULL);
-
-	room = g_new0(PurpleRoomlistRoom, 1);
-	room->type = type;
-	room->name = g_strdup(name);
-	room->parent = parent;
-
-	return room;
-}
-
-void purple_roomlist_room_add_field(PurpleRoomlist *list, PurpleRoomlistRoom *room, gconstpointer field)
-{
-	PurpleRoomlistPrivate *priv = NULL;
-	PurpleRoomlistField *f;
-
-	g_return_if_fail(PURPLE_IS_ROOMLIST(list));
-	g_return_if_fail(room != NULL);
-
-	priv = purple_roomlist_get_instance_private(list);
-	g_return_if_fail(priv->fields != NULL);
-
-	/* If this is the first call for this room, grab the first field in
-	 * the Roomlist's fields.  Otherwise, grab the field that is one
-	 * more than the number of fields already present for the room.
-         * (This works because g_list_nth_data() is zero-indexed and
-         * g_list_length() is one-indexed.) */
-	if (!room->fields)
-		f = priv->fields->data;
-	else
-		f = g_list_nth_data(priv->fields, g_list_length(room->fields));
-
-	g_return_if_fail(f != NULL);
-
-	switch(f->type) {
-		case PURPLE_ROOMLIST_FIELD_STRING:
-			room->fields = g_list_append(room->fields, g_strdup(field));
-			break;
-		case PURPLE_ROOMLIST_FIELD_BOOL:
-		case PURPLE_ROOMLIST_FIELD_INT:
-			room->fields = g_list_append(room->fields, GINT_TO_POINTER(field));
-			break;
-	}
-
-	g_object_notify_by_pspec(G_OBJECT(list), properties[PROP_FIELDS]);
-}
-
-void purple_roomlist_room_join(PurpleRoomlist *list, PurpleRoomlistRoom *room)
-{
-	PurpleRoomlistPrivate *priv = NULL;
-	GHashTable *components;
-	GList *l, *j;
-	PurpleConnection *gc;
-
-	g_return_if_fail(PURPLE_IS_ROOMLIST(list));
-	g_return_if_fail(room != NULL);
-
-	priv = purple_roomlist_get_instance_private(list);
-
-	gc = purple_account_get_connection(priv->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 = priv->fields, j = room->fields; l && j; l = l->next, j = j->next) {
-		PurpleRoomlistField *f = l->data;
-
-		g_hash_table_replace(components, f->name, j->data);
-	}
-
-	purple_serv_join_chat(gc, components);
-
-	g_hash_table_destroy(components);
-}
-
-PurpleRoomlistRoomType purple_roomlist_room_get_room_type(PurpleRoomlistRoom *room)
-{
-	return room->type;
-}
-
-const char * purple_roomlist_room_get_name(PurpleRoomlistRoom *room)
-{
-	return room->name;
-}
-
-PurpleRoomlistRoom * purple_roomlist_room_get_parent(PurpleRoomlistRoom *room)
-{
-	return room->parent;
-}
-
-gboolean purple_roomlist_room_get_expanded_once(PurpleRoomlistRoom *room)
-{
-	g_return_val_if_fail(room != NULL, FALSE);
-
-	return room->expanded_once;
-}
-
-void purple_roomlist_room_set_expanded_once(PurpleRoomlistRoom *room, gboolean expanded_once)
-{
-	g_return_if_fail(room != NULL);
-
-	room->expanded_once = expanded_once;
-}
-
-GList *purple_roomlist_room_get_fields(PurpleRoomlistRoom *room)
-{
-	return room->fields;
-}
-
-static void purple_roomlist_room_destroy(PurpleRoomlist *list, PurpleRoomlistRoom *r)
-{
-	PurpleRoomlistPrivate *priv =
-			purple_roomlist_get_instance_private(list);
-	GList *l, *j;
-
-	for (l = priv->fields, j = r->fields; l && j; l = l->next, j = j->next) {
-		PurpleRoomlistField *f = l->data;
-		if (f->type == PURPLE_ROOMLIST_FIELD_STRING)
-			g_free(j->data);
-	}
-
-	purple_roomlist_room_free(r);
-}
-
-/**************************************************************************/
-/* Room GBoxed code                                                       */
-/**************************************************************************/
-
-static PurpleRoomlistRoom *purple_roomlist_room_copy(PurpleRoomlistRoom *r)
-{
-	g_return_val_if_fail(r != NULL, NULL);
-
-	return purple_roomlist_room_new(r->type, r->name, r->parent);
-}
-
-static void purple_roomlist_room_free(PurpleRoomlistRoom *r)
-{
-	g_return_if_fail(r != NULL);
-
-	g_list_free(r->fields);
-	g_free(r->name);
-	g_free(r);
-}
-
-GType purple_roomlist_room_get_type(void)
-{
-	static GType type = 0;
-
-	if (type == 0) {
-		type = g_boxed_type_register_static("PurpleRoomlistRoom",
-				(GBoxedCopyFunc)purple_roomlist_room_copy,
-				(GBoxedFreeFunc)purple_roomlist_room_free);
-	}
-
-	return type;
-}
-
-/**************************************************************************/
-/* Room Field API                                                         */
-/**************************************************************************/
-
-PurpleRoomlistField *purple_roomlist_field_new(PurpleRoomlistFieldType type,
-                                           const gchar *label, const gchar *name,
-                                           gboolean hidden)
-{
-	PurpleRoomlistField *f;
-
-	g_return_val_if_fail(label != NULL, NULL);
-	g_return_val_if_fail(name != NULL, NULL);
-
-	f = g_new0(PurpleRoomlistField, 1);
-
-	f->type = type;
-	f->label = g_strdup(label);
-	f->name = g_strdup(name);
-	f->hidden = hidden;
-
-	return f;
-}
-
-PurpleRoomlistFieldType purple_roomlist_field_get_field_type(PurpleRoomlistField *field)
-{
-	return field->type;
-}
-
-const char * purple_roomlist_field_get_label(PurpleRoomlistField *field)
-{
-	return field->label;
-}
-
-gboolean purple_roomlist_field_get_hidden(PurpleRoomlistField *field)
-{
-	return field->hidden;
-}
-
-/**************************************************************************/
-/* Room Field GBoxed code                                                 */
-/**************************************************************************/
-
-static PurpleRoomlistField *purple_roomlist_field_copy(PurpleRoomlistField *f)
-{
-	g_return_val_if_fail(f != NULL, NULL);
-
-	return purple_roomlist_field_new(f->type, f->label, f->name, f->hidden);
-}
-
-static void purple_roomlist_field_free(PurpleRoomlistField *f)
-{
-	g_return_if_fail(f != NULL);
-
-	g_free(f->label);
-	g_free(f->name);
-	g_free(f);
-}
-
-GType purple_roomlist_field_get_type(void)
-{
-	static GType type = 0;
-
-	if (type == 0) {
-		type = g_boxed_type_register_static("PurpleRoomlistField",
-				(GBoxedCopyFunc)purple_roomlist_field_copy,
-				(GBoxedFreeFunc)purple_roomlist_field_free);
-	}
-
-	return type;
-}
-
-/**************************************************************************/
 /* UI Registration Functions                                              */
 /**************************************************************************/
 
diff --git a/pidgin/gtkroomlist.c b/pidgin/gtkroomlist.c
--- a/pidgin/gtkroomlist.c
+++ b/pidgin/gtkroomlist.c
@@ -41,7 +41,7 @@
 
 	GtkWidget *account_widget;
 	GtkWidget *progress;
-	GtkWidget *sw;
+	GtkWidget *tree;
 
 	GtkWidget *stop_button;
 	GtkWidget *list_button;
@@ -61,17 +61,35 @@
 typedef struct {
 	PidginRoomlistDialog *dialog;
 	GtkTreeStore *model;
-	GtkWidget *tree;
-	GHashTable *cats; /* Meow. */
-	gint num_rooms, total_rooms;
 } PidginRoomlist;
 
 enum {
-	NAME_COLUMN = 0,
-	ROOM_COLUMN,
+	ROOM_COLUMN = 0,
+	NAME_COLUMN,
+	DESCRIPTION_COLUMN,
 	NUM_OF_COLUMNS,
 };
 
+static gboolean
+_search_func(GtkTreeModel *model, gint column, const gchar *key,
+             GtkTreeIter *iter, gpointer search_data)
+{
+	gboolean result;
+	gchar *name, *fold, *fkey;
+
+	gtk_tree_model_get(model, iter, column, &name, -1);
+	fold = g_utf8_casefold(name, -1);
+	fkey = g_utf8_casefold(key, -1);
+
+	result = (g_strstr_len(fold, strlen(fold), fkey) == NULL);
+
+	g_free(fold);
+	g_free(fkey);
+	g_free(name);
+
+	return result;
+}
+
 static gint delete_win_cb(GtkWidget *w, GdkEventAny *e, gpointer d)
 {
 	PidginRoomlistDialog *dialog = PIDGIN_ROOMLIST_DIALOG(w);
@@ -114,10 +132,8 @@
 
 		rl = g_object_get_data(G_OBJECT(dialog->roomlist),
 		                       PIDGIN_ROOMLIST_UI_DATA);
-		if (rl->tree) {
-			gtk_widget_destroy(rl->tree);
-			rl->tree = NULL;
-		}
+
+		g_clear_object(&rl->model);
 		g_object_unref(dialog->roomlist);
 		dialog->roomlist = NULL;
 	}
@@ -136,7 +152,7 @@
 		rl = g_object_get_data(G_OBJECT(dialog->roomlist),
 		                       PIDGIN_ROOMLIST_UI_DATA);
 
-		gtk_widget_destroy(rl->tree);
+		g_clear_object(&rl->model);
 		g_object_unref(dialog->roomlist);
 	}
 
@@ -151,7 +167,8 @@
 
 	gtk_widget_set_sensitive(dialog->account_widget, FALSE);
 
-	gtk_container_add(GTK_CONTAINER(dialog->sw), rl->tree);
+	gtk_tree_view_set_model(GTK_TREE_VIEW(dialog->tree),
+	                        GTK_TREE_MODEL(rl->model));
 
 	/* some protocols (not bundled with libpurple) finish getting their
 	 * room list immediately */
@@ -184,22 +201,21 @@
 };
 
 static void
-selection_changed_cb(GtkTreeSelection *selection, PidginRoomlist *grl) {
+selection_changed_cb(GtkTreeSelection *selection,
+                     PidginRoomlistDialog *dialog)
+{
 	GtkTreeIter iter;
-	GValue val;
 	PurpleRoomlistRoom *room;
 	static struct _menu_cb_info *info;
-	PidginRoomlistDialog *dialog = grl->dialog;
+	PidginRoomlist *grl = NULL;
+
+	grl = g_object_get_data(G_OBJECT(dialog->roomlist),
+	                        PIDGIN_ROOMLIST_UI_DATA);
 
 	if (gtk_tree_selection_get_selected(selection, NULL, &iter)) {
-		val.g_type = 0;
-		gtk_tree_model_get_value(GTK_TREE_MODEL(grl->model), &iter, ROOM_COLUMN, &val);
-		room = g_value_get_pointer(&val);
-		if (!room || !(purple_roomlist_room_get_room_type(room) & PURPLE_ROOMLIST_ROOMTYPE_ROOM)) {
-			gtk_widget_set_sensitive(dialog->join_button, FALSE);
-			gtk_widget_set_sensitive(dialog->add_button, FALSE);
-			return;
-		}
+		gtk_tree_model_get(GTK_TREE_MODEL(grl->model), &iter,
+		                   ROOM_COLUMN, &room,
+		                   -1);
 
 		info = g_new0(struct _menu_cb_info, 1);
 		info->list = dialog->roomlist;
@@ -211,6 +227,8 @@
 
 		gtk_widget_set_sensitive(dialog->add_button, TRUE);
 		gtk_widget_set_sensitive(dialog->join_button, TRUE);
+
+		g_object_unref(room);
 	} else {
 		gtk_widget_set_sensitive(dialog->add_button, FALSE);
 		gtk_widget_set_sensitive(dialog->join_button, FALSE);
@@ -252,50 +270,45 @@
 }
 
 static void
-do_join_cb(G_GNUC_UNUSED GtkWidget *w, struct _menu_cb_info *info)
-{
-	purple_roomlist_room_join(info->list, info->room);
+do_join_cb(G_GNUC_UNUSED GtkWidget *w, struct _menu_cb_info *info) {
+	purple_roomlist_join_room(info->list, info->room);
 }
 
 static void
-join_button_cb(GtkButton *button, G_GNUC_UNUSED gpointer data)
-{
+join_button_cb(GtkButton *button, G_GNUC_UNUSED gpointer data) {
 	struct _menu_cb_info *info = g_object_get_data(G_OBJECT(button), "room-info");
 
-	if(info != NULL) {
-		do_join_cb(NULL, info);
-	}
+	purple_roomlist_join_room(info->list, info->room);
 }
 
-static void row_activated_cb(GtkTreeView *tv, GtkTreePath *path, GtkTreeViewColumn *arg2,
-                      PurpleRoomlist *list)
+static void
+row_activated_cb(GtkTreeView *tv, GtkTreePath *path, GtkTreeViewColumn *arg2,
+                 gpointer data)
 {
+	PidginRoomlistDialog *dialog = data;
 	PidginRoomlist *grl = NULL;
 	GtkTreeIter iter;
 	PurpleRoomlistRoom *room;
-	GValue val;
 	struct _menu_cb_info info;
 
-	grl = g_object_get_data(G_OBJECT(list), PIDGIN_ROOMLIST_UI_DATA);
+	grl = g_object_get_data(G_OBJECT(dialog->roomlist), PIDGIN_ROOMLIST_UI_DATA);
 
 	gtk_tree_model_get_iter(GTK_TREE_MODEL(grl->model), &iter, path);
-	val.g_type = 0;
-	gtk_tree_model_get_value(GTK_TREE_MODEL(grl->model), &iter, ROOM_COLUMN, &val);
-	room = g_value_get_pointer(&val);
-	if (!room || !(purple_roomlist_room_get_room_type(room) & PURPLE_ROOMLIST_ROOMTYPE_ROOM))
-		return;
+	gtk_tree_model_get(GTK_TREE_MODEL(grl->model), &iter, ROOM_COLUMN, &room, -1);
 
-	info.list = list;
+	info.list = dialog->roomlist;
 	info.room = room;
 
 	do_join_cb(NULL, &info);
+
+	g_clear_object(&room);
 }
 
-static gboolean room_click_cb(GtkWidget *tv, GdkEventButton *event, PurpleRoomlist *list)
-{
+static gboolean
+room_click_cb(GtkWidget *tv, GdkEventButton *event, gpointer data) {
+	PidginRoomlistDialog *dialog = data;
 	GtkTreePath *path;
 	PidginRoomlist *grl = NULL;
-	GValue val;
 	PurpleRoomlistRoom *room;
 	GtkTreeIter iter;
 	GtkWidget *menu;
@@ -305,22 +318,22 @@
 	if (!gdk_event_triggers_context_menu((GdkEvent *)event))
 		return FALSE;
 
-	grl = g_object_get_data(G_OBJECT(list), PIDGIN_ROOMLIST_UI_DATA);
+	grl = g_object_get_data(G_OBJECT(dialog->roomlist), PIDGIN_ROOMLIST_UI_DATA);
 
 	/* Here we figure out which room was clicked */
 	if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tv), event->x, event->y, &path, NULL, NULL, NULL))
 		return FALSE;
 	gtk_tree_model_get_iter(GTK_TREE_MODEL(grl->model), &iter, path);
 	gtk_tree_path_free(path);
-	val.g_type = 0;
-	gtk_tree_model_get_value (GTK_TREE_MODEL(grl->model), &iter, ROOM_COLUMN, &val);
-	room = g_value_get_pointer(&val);
+	gtk_tree_model_get(GTK_TREE_MODEL(grl->model), &iter, ROOM_COLUMN, &room, -1);
+
+	info.list = dialog->roomlist;
+	info.room = room;
 
-	if (!room || !(purple_roomlist_room_get_room_type(room) & PURPLE_ROOMLIST_ROOMTYPE_ROOM))
-		return FALSE;
-
-	info.list = list;
-	info.room = room;
+	/* The current implementation isn't expecting a ref to unref the one we got
+	 * when we pulled the room out of the model.
+	 */
+	g_clear_object(&room);
 
 	menu = gtk_menu_new();
 
@@ -340,22 +353,6 @@
 	return FALSE;
 }
 
-static void row_expanded_cb(GtkTreeView *treeview, GtkTreeIter *arg1, GtkTreePath *arg2, gpointer user_data)
-{
-	PurpleRoomlist *list = user_data;
-	PurpleRoomlistRoom *category;
-	GValue val;
-
-	val.g_type = 0;
-	gtk_tree_model_get_value(gtk_tree_view_get_model(treeview), arg1, ROOM_COLUMN, &val);
-	category = g_value_get_pointer(&val);
-
-	if (!purple_roomlist_room_get_expanded_once(category)) {
-		purple_roomlist_expand_category(list, category);
-		purple_roomlist_room_set_expanded_once(category, TRUE);
-	}
-}
-
 #define SMALL_SPACE 6
 
 static gboolean
@@ -363,19 +360,14 @@
                               gboolean keyboard_mode, GtkTooltip *tooltip,
                               gpointer data)
 {
-	PurpleRoomlist *list = data;
+	PidginRoomlistDialog *dialog = data;
 	PidginRoomlist *grl = NULL;
 	GtkTreePath *path = NULL;
-	PurpleRoomlistRoom *room;
 	GtkTreeIter iter;
-	GValue val;
 	gchar *name, *tmp;
 	GString *tooltip_text = NULL;
-	GList *l, *k;
-	gint j;
-	gboolean first = TRUE;
 
-	grl = g_object_get_data(G_OBJECT(list), PIDGIN_ROOMLIST_UI_DATA);
+	grl = g_object_get_data(G_OBJECT(dialog->roomlist), PIDGIN_ROOMLIST_UI_DATA);
 
 	if (keyboard_mode) {
 		GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget));
@@ -400,18 +392,6 @@
 		}
 	}
 
-	val.g_type = 0;
-	gtk_tree_model_get_value(GTK_TREE_MODEL(grl->model), &iter, ROOM_COLUMN,
-	                         &val);
-	room = g_value_get_pointer(&val);
-
-	if (!room ||
-	    !(purple_roomlist_room_get_room_type(room) & PURPLE_ROOMLIST_ROOMTYPE_ROOM))
-	{
-		gtk_tree_path_free(path);
-		return FALSE;
-	}
-
 	tooltip_text = g_string_new("");
 
 	gtk_tree_model_get(GTK_TREE_MODEL(grl->model), &iter, NAME_COLUMN, &name, -1);
@@ -421,41 +401,6 @@
 	    tooltip_text, "<span size='x-large' weight='bold'>%s</span>\n", tmp);
 	g_free(tmp);
 
-	for (j = NUM_OF_COLUMNS,
-	     l = purple_roomlist_room_get_fields(room),
-	     k = purple_roomlist_get_fields(list);
-	     l && k;
-	     j++, l = l->next, k = k->next)
-	{
-		PurpleRoomlistField *f = k->data;
-		gchar *label;
-		if (purple_roomlist_field_get_hidden(f)) {
-			continue;
-		}
-		label = g_markup_escape_text(purple_roomlist_field_get_label(f), -1);
-		switch (purple_roomlist_field_get_field_type(f)) {
-			case PURPLE_ROOMLIST_FIELD_BOOL:
-				g_string_append_printf(
-				    tooltip_text, "%s<b>%s:</b> %s", first ? "" : "\n", label,
-				    l->data ? "True" : "False");
-				break;
-			case PURPLE_ROOMLIST_FIELD_INT:
-				g_string_append_printf(
-				    tooltip_text, "%s<b>%s:</b> %d", first ? "" : "\n", label,
-				    GPOINTER_TO_INT(l->data));
-				break;
-			case PURPLE_ROOMLIST_FIELD_STRING:
-				tmp = g_markup_escape_text((char *)l->data, -1);
-				g_string_append_printf(
-				    tooltip_text, "%s<b>%s:</b> %s", first ? "" : "\n", label,
-				    tmp);
-				g_free(tmp);
-				break;
-		}
-		first = FALSE;
-		g_free(label);
-	}
-
 	gtk_tooltip_set_markup(tooltip, tooltip_text->str);
 	gtk_tree_view_set_tooltip_row(GTK_TREE_VIEW(widget), tooltip, path);
 	g_string_free(tooltip_text, TRUE);
@@ -502,6 +447,8 @@
 	gtk_widget_class_bind_template_child(widget_class, PidginRoomlistDialog,
 	                                     account_widget);
 	gtk_widget_class_bind_template_child(widget_class, PidginRoomlistDialog,
+	                                     tree);
+	gtk_widget_class_bind_template_child(widget_class, PidginRoomlistDialog,
 	                                     add_button);
 	gtk_widget_class_bind_template_child(widget_class, PidginRoomlistDialog,
 	                                     close_button);
@@ -513,14 +460,18 @@
 	                                     progress);
 	gtk_widget_class_bind_template_child(widget_class, PidginRoomlistDialog,
 	                                     stop_button);
-	gtk_widget_class_bind_template_child(widget_class, PidginRoomlistDialog,
-	                                     sw);
 
 	gtk_widget_class_bind_template_callback(widget_class,
 	                                        add_room_to_blist_cb);
 	gtk_widget_class_bind_template_callback(widget_class, delete_win_cb);
+	gtk_widget_class_bind_template_callback(widget_class, row_activated_cb);
+	gtk_widget_class_bind_template_callback(widget_class, room_click_cb);
 	gtk_widget_class_bind_template_callback(widget_class,
 	                                        dialog_select_account_cb);
+	gtk_widget_class_bind_template_callback(widget_class,
+	                                        selection_changed_cb);
+	gtk_widget_class_bind_template_callback(widget_class,
+	                                        pidgin_roomlist_query_tooltip);
 	gtk_widget_class_bind_template_callback(widget_class, join_button_cb);
 	gtk_widget_class_bind_template_callback(widget_class, list_button_cb);
 	gtk_widget_class_bind_template_callback(widget_class, stop_button_cb);
@@ -534,6 +485,9 @@
 	pidgin_account_chooser_set_filter_func(
 	        PIDGIN_ACCOUNT_CHOOSER(self->account_widget),
 	        account_filter_func);
+
+	gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(self->tree),
+	                                    _search_func, NULL, NULL);
 }
 
 static PidginRoomlistDialog *
@@ -576,161 +530,6 @@
 	pidgin_roomlist_dialog_new_with_account(NULL);
 }
 
-static void int_cell_data_func(GtkTreeViewColumn *col, GtkCellRenderer *renderer,
-                                   GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
-{
-	gchar buf[16];
-	int myint;
-
-	gtk_tree_model_get(model, iter, GPOINTER_TO_INT(user_data), &myint, -1);
-
-	if (myint)
-		g_snprintf(buf, sizeof(buf), "%d", myint);
-	else
-		buf[0] = '\0';
-
-	g_object_set(renderer, "text", buf, NULL);
-}
-
-/* this sorts backwards on purpose, so that clicking name sorts a-z, while clicking users sorts
-   infinity-0. you can still click again to reverse it on any of them. */
-static gint int_sort_func(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data)
-{
-	int c, d;
-
-	c = d = 0;
-
-	gtk_tree_model_get(model, a, GPOINTER_TO_INT(user_data), &c, -1);
-	gtk_tree_model_get(model, b, GPOINTER_TO_INT(user_data), &d, -1);
-
-	if (c == d)
-		return 0;
-	else if (c > d)
-		return -1;
-	else
-		return 1;
-}
-
-static gboolean
-_search_func(GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer search_data)
-{
-	gboolean result;
-	gchar *name, *fold, *fkey;
-
-	gtk_tree_model_get(model, iter, column, &name, -1);
-	fold = g_utf8_casefold(name, -1);
-	fkey = g_utf8_casefold(key, -1);
-
-	result = (g_strstr_len(fold, strlen(fold), fkey) == NULL);
-
-	g_free(fold);
-	g_free(fkey);
-	g_free(name);
-
-	return result;
-}
-
-static void pidgin_roomlist_set_fields(PurpleRoomlist *list, GList *fields)
-{
-	PidginRoomlist *grl = NULL;
-	gint columns = NUM_OF_COLUMNS;
-	int j;
-	GtkTreeStore *model;
-	GtkWidget *tree;
-	GtkCellRenderer *renderer;
-	GtkTreeViewColumn *column;
-	GtkTreeSelection *selection;
-	GList *l;
-	GType *types;
-
-	grl = g_object_get_data(G_OBJECT(list), PIDGIN_ROOMLIST_UI_DATA);
-	g_return_if_fail(grl != NULL);
-
-	columns += g_list_length(fields);
-	types = g_new(GType, columns);
-
-	types[NAME_COLUMN] = G_TYPE_STRING;
-	types[ROOM_COLUMN] = G_TYPE_POINTER;
-
-	for (j = NUM_OF_COLUMNS, l = fields; l; l = l->next, j++) {
-		PurpleRoomlistField *f = l->data;
-
-		switch (purple_roomlist_field_get_field_type(f)) {
-		case PURPLE_ROOMLIST_FIELD_BOOL:
-			types[j] = G_TYPE_BOOLEAN;
-			break;
-		case PURPLE_ROOMLIST_FIELD_INT:
-			types[j] = G_TYPE_INT;
-			break;
-		case PURPLE_ROOMLIST_FIELD_STRING:
-			types[j] = G_TYPE_STRING;
-			break;
-		}
-	}
-
-	model = gtk_tree_store_newv(columns, types);
-	g_free(types);
-
-	tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
-
-	selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree));
-	g_signal_connect(G_OBJECT(selection), "changed",
-					 G_CALLBACK(selection_changed_cb), grl);
-
-	g_object_unref(model);
-
-	grl->model = model;
-	grl->tree = tree;
-	gtk_widget_show(grl->tree);
-
-	renderer = gtk_cell_renderer_text_new();
-	column = gtk_tree_view_column_new_with_attributes(_("Name"), renderer,
-				"text", NAME_COLUMN, NULL);
-	gtk_tree_view_column_set_sizing(GTK_TREE_VIEW_COLUMN(column),
-	                                GTK_TREE_VIEW_COLUMN_GROW_ONLY);
-	gtk_tree_view_column_set_resizable(GTK_TREE_VIEW_COLUMN(column), TRUE);
-	gtk_tree_view_column_set_sort_column_id(GTK_TREE_VIEW_COLUMN(column), NAME_COLUMN);
-	gtk_tree_view_column_set_reorderable(GTK_TREE_VIEW_COLUMN(column), TRUE);
-	gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
-
-	for (j = NUM_OF_COLUMNS, l = fields; l; l = l->next, j++) {
-		PurpleRoomlistField *f = l->data;
-
-		if (purple_roomlist_field_get_hidden(f))
-			continue;
-
-		renderer = gtk_cell_renderer_text_new();
-		column = gtk_tree_view_column_new_with_attributes(
-				purple_roomlist_field_get_label(f), renderer,
-				"text", j, NULL);
-		gtk_tree_view_column_set_sizing(GTK_TREE_VIEW_COLUMN(column),
-		                                GTK_TREE_VIEW_COLUMN_GROW_ONLY);
-		gtk_tree_view_column_set_resizable(GTK_TREE_VIEW_COLUMN(column), TRUE);
-		gtk_tree_view_column_set_sort_column_id(GTK_TREE_VIEW_COLUMN(column), j);
-		gtk_tree_view_column_set_reorderable(GTK_TREE_VIEW_COLUMN(column), TRUE);
-		if (purple_roomlist_field_get_field_type(f) == PURPLE_ROOMLIST_FIELD_INT) {
-			gtk_tree_view_column_set_cell_data_func(column, renderer, int_cell_data_func,
-			                                        GINT_TO_POINTER(j), NULL);
-			gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(model), j, int_sort_func,
-			                                GINT_TO_POINTER(j), NULL);
-		}
-		gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
-	}
-
-	g_signal_connect(G_OBJECT(tree), "button-press-event", G_CALLBACK(room_click_cb), list);
-	g_signal_connect(G_OBJECT(tree), "row-expanded", G_CALLBACK(row_expanded_cb), list);
-	g_signal_connect(G_OBJECT(tree), "row-activated", G_CALLBACK(row_activated_cb), list);
-
-	gtk_widget_set_has_tooltip(tree, TRUE);
-	g_signal_connect(G_OBJECT(tree), "query-tooltip",
-	                 G_CALLBACK(pidgin_roomlist_query_tooltip), list);
-
-	/* Enable CTRL+F searching */
-	gtk_tree_view_set_search_column(GTK_TREE_VIEW(tree), NAME_COLUMN);
-	gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(tree), _search_func, NULL, NULL);
-
-}
-
 static gboolean pidgin_progress_bar_pulse(gpointer data)
 {
 	PurpleRoomlist *list = data;
@@ -749,22 +548,14 @@
 	return TRUE;
 }
 
-static void pidgin_roomlist_add_room(PurpleRoomlist *list, PurpleRoomlistRoom *room)
-{
+static void
+pidgin_roomlist_add_room(PurpleRoomlist *list, PurpleRoomlistRoom *room) {
 	PidginRoomlist *rl = NULL;
-	GtkTreeRowReference *rr, *parentrr = NULL;
 	GtkTreePath *path;
-	GtkTreeIter iter, parent, child;
-	GList *l, *k;
-	int j;
-	gboolean append = TRUE;
+	GtkTreeIter iter;
 
 	rl = g_object_get_data(G_OBJECT(list), PIDGIN_ROOMLIST_UI_DATA);
 
-	rl->total_rooms++;
-	if (purple_roomlist_room_get_room_type(room) == PURPLE_ROOMLIST_ROOMTYPE_ROOM)
-		rl->num_rooms++;
-
 	if (rl->dialog) {
 		if (rl->dialog->pg_update_to == 0) {
 			g_object_ref(list);
@@ -774,53 +565,18 @@
 			rl->dialog->pg_needs_pulse = TRUE;
 	}
 
-	if (purple_roomlist_room_get_parent(room)) {
-		parentrr = g_hash_table_lookup(rl->cats, purple_roomlist_room_get_parent(room));
-		path = gtk_tree_row_reference_get_path(parentrr);
-		if (path) {
-			PurpleRoomlistRoom *tmproom = NULL;
-
-			gtk_tree_model_get_iter(GTK_TREE_MODEL(rl->model), &parent, path);
-			gtk_tree_path_free(path);
-
-			if (gtk_tree_model_iter_children(GTK_TREE_MODEL(rl->model), &child, &parent)) {
-				gtk_tree_model_get(GTK_TREE_MODEL(rl->model), &child, ROOM_COLUMN, &tmproom, -1);
-				if (!tmproom)
-					append = FALSE;
-			}
-		}
-	}
-
-	if (append)
-		gtk_tree_store_append(rl->model, &iter, (parentrr ? &parent : NULL));
-	else
-		iter = child;
-
-	if (purple_roomlist_room_get_room_type(room) & PURPLE_ROOMLIST_ROOMTYPE_CATEGORY)
-		gtk_tree_store_append(rl->model, &child, &iter);
+	gtk_tree_store_append(rl->model, &iter, NULL);
 
 	path = gtk_tree_model_get_path(GTK_TREE_MODEL(rl->model), &iter);
 
-	if (purple_roomlist_room_get_room_type(room) & PURPLE_ROOMLIST_ROOMTYPE_CATEGORY) {
-		rr = gtk_tree_row_reference_new(GTK_TREE_MODEL(rl->model), path);
-		g_hash_table_insert(rl->cats, room, rr);
-	}
-
 	gtk_tree_path_free(path);
 
-	gtk_tree_store_set(rl->model, &iter, NAME_COLUMN, purple_roomlist_room_get_name(room), -1);
-	gtk_tree_store_set(rl->model, &iter, ROOM_COLUMN, room, -1);
-
-	for (j = NUM_OF_COLUMNS,
-				l = purple_roomlist_room_get_fields(room),
-				k = purple_roomlist_get_fields(list);
-			l && k; j++, l = l->next, k = k->next)
-	{
-		PurpleRoomlistField *f = k->data;
-		if (purple_roomlist_field_get_hidden(f))
-			continue;
-		gtk_tree_store_set(rl->model, &iter, j, l->data, -1);
-	}
+	gtk_tree_store_set(
+		rl->model, &iter,
+		ROOM_COLUMN, room,
+		NAME_COLUMN, purple_roomlist_room_get_name(room),
+		DESCRIPTION_COLUMN, purple_roomlist_room_get_description(room),
+		-1);
 }
 
 static void
@@ -850,7 +606,6 @@
 static void
 pidgin_roomlist_destroy(PidginRoomlist *rl)
 {
-	g_hash_table_destroy(rl->cats);
 	g_free(rl);
 }
 
@@ -862,8 +617,8 @@
 	g_object_set_data_full(G_OBJECT(list), PIDGIN_ROOMLIST_UI_DATA, rl,
 	                       (GDestroyNotify)pidgin_roomlist_destroy);
 
-	rl->cats = g_hash_table_new_full(
-	        NULL, NULL, NULL, (GDestroyNotify)gtk_tree_row_reference_free);
+	rl->model = gtk_tree_store_new(3, G_TYPE_OBJECT, G_TYPE_STRING,
+	                               G_TYPE_STRING);
 
 	g_signal_connect(list, "notify::in-progress",
 	                 G_CALLBACK(pidgin_roomlist_in_progress), rl);
@@ -872,7 +627,7 @@
 static PurpleRoomlistUiOps ops = {
 	pidgin_roomlist_dialog_show_with_account,
 	pidgin_roomlist_new,
-	pidgin_roomlist_set_fields,
+	NULL,
 	pidgin_roomlist_add_room,
 	NULL,
 	NULL,
diff --git a/pidgin/pidgincolor.c b/pidgin/pidgincolor.c
--- a/pidgin/pidgincolor.c
+++ b/pidgin/pidgincolor.c
@@ -41,7 +41,9 @@
 
     /* hash the string and get the first 2 bytes of the digest */
     checksum = g_checksum_new(G_CHECKSUM_SHA1);
-    g_checksum_update(checksum, (const guchar *)text, -1);
+    if(text != NULL) {
+        g_checksum_update(checksum, (const guchar *)text, -1);
+    }
     g_checksum_get_digest(checksum, digest, &digest_len);
     g_checksum_free(checksum);
 
diff --git a/pidgin/resources/Roomlist/roomlist.ui b/pidgin/resources/Roomlist/roomlist.ui
--- a/pidgin/resources/Roomlist/roomlist.ui
+++ b/pidgin/resources/Roomlist/roomlist.ui
@@ -186,7 +186,41 @@
                 <property name="shadow-type">in</property>
                 <property name="min-content-height">250</property>
                 <child>
-                  <placeholder/>
+                  <object class="GtkTreeView" id="tree">
+                    <property name="visible">True</property>
+                    <property name="can-focus">True</property>
+                    <property name="search-column">1</property>
+                    <signal name="button-press-event" handler="room_click_cb" object="PidginRoomlistDialog" swapped="no"/>
+                    <signal name="query-tooltip" handler="pidgin_roomlist_query_tooltip" object="PidginRoomlistDialog" swapped="no"/>
+                    <signal name="row-activated" handler="row_activated_cb" object="PidginRoomlistDialog" swapped="no"/>
+                    <child internal-child="selection">
+                      <object class="GtkTreeSelection" id="tree_selection">
+                        <signal name="changed" handler="selection_changed_cb" object="PidginRoomlistDialog" swapped="no"/>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkTreeViewColumn">
+                        <property name="title" translatable="yes">Name</property>
+                        <child>
+                          <object class="GtkCellRendererText"/>
+                          <attributes>
+                            <attribute name="markup">1</attribute>
+                          </attributes>
+                        </child>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkTreeViewColumn">
+                        <property name="title" translatable="yes">Description</property>
+                        <child>
+                          <object class="GtkCellRendererText"/>
+                          <attributes>
+                            <attribute name="markup">2</attribute>
+                          </attributes>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
                 </child>
               </object>
               <packing>
