# HG changeset patch
# Node ID 0042b1f647e7
# Parent  aa9a8041c440
diff --git a/finch/gntplugin.c b/finch/gntplugin.c
--- a/finch/gntplugin.c
+++ b/finch/gntplugin.c
@@ -581,7 +581,8 @@ process_pref_frame(PurplePluginPrefFrame
 			}
 
 			field = purple_request_field_list_new(name, label);
-			purple_request_field_list_set_multi_select(field, FALSE);
+			purple_request_field_list_set_multi_select(PURPLE_REQUEST_FIELD_LIST(field),
+			                                           FALSE);
 			for (GList *list = purple_plugin_pref_get_choices(pref); list != NULL; list = list->next) {
 				const PurpleKeyValuePair *choice = list->data;
 				char *value = NULL;
@@ -599,9 +600,12 @@ process_pref_frame(PurplePluginPrefFrame
 						break;
 				}
 				stringlist = g_list_prepend(stringlist, value);
-				purple_request_field_list_add_icon(field, choice->key, NULL, value);
-				if (purple_strequal(value, current_value))
-					purple_request_field_list_add_selected(field, choice->key);
+				purple_request_field_list_add_icon(PURPLE_REQUEST_FIELD_LIST(field),
+				                                   choice->key, NULL, value);
+				if(purple_strequal(value, current_value)) {
+					purple_request_field_list_add_selected(PURPLE_REQUEST_FIELD_LIST(field),
+					                                       choice->key);
+				}
 			}
 			g_free(current_value);
 		} else {
diff --git a/finch/gntprefs.c b/finch/gntprefs.c
--- a/finch/gntprefs.c
+++ b/finch/gntprefs.c
@@ -153,11 +153,15 @@ get_pref_field(Prefs *prefs)
 	}
 	else
 	{
-		GList *list = prefs->lv(), *iter;
-		if (list)
+		PurpleRequestFieldList *lfield = NULL;
+		GList *list = NULL;
+
+		list = prefs->lv();
+		if(list != NULL) {
 			field = purple_request_field_list_new(prefs->pref, _(prefs->label));
-		for (iter = list; iter; iter = iter->next)
-		{
+			lfield = PURPLE_REQUEST_FIELD_LIST(field);
+		}
+		for(GList *iter = list; iter; iter = iter->next) {
 			gboolean select = FALSE;
 			const char *data = iter->data;
 			int idata;
@@ -183,9 +187,10 @@ get_pref_field(Prefs *prefs)
 				default:
 					break;
 			}
-			purple_request_field_list_add_icon(field, data, NULL, iter->data);
-			if (select)
-				purple_request_field_list_add_selected(field, data);
+			purple_request_field_list_add_icon(lfield, data, NULL, iter->data);
+			if(select) {
+				purple_request_field_list_add_selected(lfield, data);
+			}
 		}
 		g_list_free(list);
 	}
diff --git a/finch/gntrequest.c b/finch/gntrequest.c
--- a/finch/gntrequest.c
+++ b/finch/gntrequest.c
@@ -290,7 +290,6 @@ request_fields_cb(GntWidget *button, Pur
 		for (; fields ; fields = fields->next)
 		{
 			PurpleRequestField *field = fields->data;
-			PurpleRequestFieldType type = purple_request_field_get_field_type(field);
 			if (!purple_request_field_is_visible(field))
 				continue;
 			if(PURPLE_IS_REQUEST_FIELD_BOOL(field)) {
@@ -321,13 +320,11 @@ request_fields_cb(GntWidget *button, Pur
 				gpointer value = gnt_combo_box_get_selected_data(GNT_COMBO_BOX(combo));
 				purple_request_field_choice_set_value(PURPLE_REQUEST_FIELD_CHOICE(field),
 				                                      value);
-			}
-			else if (type == PURPLE_REQUEST_FIELD_LIST)
-			{
+			} else if(PURPLE_IS_REQUEST_FIELD_LIST(field)) {
+				PurpleRequestFieldList *lfield = PURPLE_REQUEST_FIELD_LIST(field);
 				GList *selected = NULL;
-				GList *list = purple_request_field_list_get_items(field);
-				if (purple_request_field_list_get_multi_select(field))
-				{
+				GList *list = purple_request_field_list_get_items(lfield);
+				if(purple_request_field_list_get_multi_select(lfield)) {
 					GntWidget *tree = g_object_get_data(G_OBJECT(field),
 					                                    "finch-ui-data");
 
@@ -335,7 +332,9 @@ request_fields_cb(GntWidget *button, Pur
 					{
 						PurpleKeyValuePair *item = list->data;
 						const char *text = item->key;
-						gpointer key = purple_request_field_list_get_data(field, text);
+						gpointer key = NULL;
+
+						key = purple_request_field_list_get_data(lfield, text);
 						if (gnt_tree_get_choice(GNT_TREE(tree), key)) {
 							selected = g_list_prepend(selected, (gpointer)text);
 						}
@@ -350,7 +349,9 @@ request_fields_cb(GntWidget *button, Pur
 					for (; list; list = list->next) {
 						PurpleKeyValuePair *item = list->data;
 						const char *text = item->key;
-						gpointer key = purple_request_field_list_get_data(field, text);
+						gpointer key = NULL;
+
+						key = purple_request_field_list_get_data(lfield, text);
 						if (key == data) {
 							selected = g_list_prepend(selected, (gpointer)text);
 							break;
@@ -358,7 +359,7 @@ request_fields_cb(GntWidget *button, Pur
 					}
 				}
 
-				purple_request_field_list_set_selected(field, selected);
+				purple_request_field_list_set_selected(lfield, selected);
 				g_list_free(selected);
 
 			} else if (PURPLE_IS_REQUEST_FIELD_ACCOUNT(field)) {
@@ -488,20 +489,22 @@ create_choice_field(PurpleRequestField *
 static GntWidget*
 create_list_field(PurpleRequestField *field)
 {
+	PurpleRequestFieldList *lfield = PURPLE_REQUEST_FIELD_LIST(field);
 	GntWidget *ret = NULL;
-	GList *list = purple_request_field_list_get_items(field);
-	if (purple_request_field_list_get_multi_select(field)) {
+	GList *list = purple_request_field_list_get_items(lfield);
+	if(purple_request_field_list_get_multi_select(lfield)) {
 		GntWidget *tree = gnt_tree_new();
 
 		for (; list; list = list->next)
 		{
 			PurpleKeyValuePair *item = list->data;
 			const char *text = item->key;
-			gpointer key = purple_request_field_list_get_data(field, text);
+			gpointer key = purple_request_field_list_get_data(lfield, text);
 			gnt_tree_add_choice(GNT_TREE(tree), key,
 					gnt_tree_create_row(GNT_TREE(tree), text), NULL, NULL);
-			if (purple_request_field_list_is_selected(field, text))
+			if(purple_request_field_list_is_selected(lfield, text)) {
 				gnt_tree_set_choice(GNT_TREE(tree), key, TRUE);
+			}
 		}
 		ret = tree;
 	}
@@ -513,10 +516,11 @@ create_list_field(PurpleRequestField *fi
 		{
 			PurpleKeyValuePair *item = list->data;
 			const char *text = item->key;
-			gpointer key = purple_request_field_list_get_data(field, text);
+			gpointer key = purple_request_field_list_get_data(lfield, text);
 			gnt_combo_box_add_data(GNT_COMBO_BOX(combo), key, text);
-			if (purple_request_field_list_is_selected(field, text))
+			if(purple_request_field_list_is_selected(lfield, text)) {
 				gnt_combo_box_set_selected(GNT_COMBO_BOX(combo), key);
+			}
 		}
 		ret = combo;
 	}
@@ -641,7 +645,6 @@ finch_request_fields(const char *title, 
 		for (; fields ; fields = fields->next)
 		{
 			PurpleRequestField *field = fields->data;
-			PurpleRequestFieldType type = purple_request_field_get_field_type(field);
 			const char *label = purple_request_field_get_label(field);
 			GntWidget *widget = NULL;
 
@@ -669,7 +672,7 @@ finch_request_fields(const char *title, 
 				widget = create_integer_field(field);
 			} else if(PURPLE_IS_REQUEST_FIELD_CHOICE(field)) {
 				widget = create_choice_field(field);
-			} else if (type == PURPLE_REQUEST_FIELD_LIST) {
+			} else if(PURPLE_IS_REQUEST_FIELD_LIST(field)) {
 				widget = create_list_field(field);
 			} else if(PURPLE_IS_REQUEST_FIELD_ACCOUNT(field)) {
 				accountlist = create_account_field(field);
@@ -869,12 +872,15 @@ finch_request_save_in_prefs(G_GNUC_UNUSE
 
 		for (; fields ; fields = fields->next) {
 			PurpleRequestField *field = fields->data;
-			PurpleRequestFieldType type = purple_request_field_get_field_type(field);
 			PurplePrefType pt;
 			gpointer val = NULL;
 			const char *id = purple_request_field_get_id(field);
 
-			if(PURPLE_IS_REQUEST_FIELD_BOOL(field)) {
+			if(PURPLE_IS_REQUEST_FIELD_LIST(field)) {
+				PurpleRequestFieldList *lfield = PURPLE_REQUEST_FIELD_LIST(field);
+				val = purple_request_field_list_get_selected(lfield)->data;
+				val = purple_request_field_list_get_data(lfield, val);
+			} else if(PURPLE_IS_REQUEST_FIELD_BOOL(field)) {
 				PurpleRequestFieldBool *bfield = PURPLE_REQUEST_FIELD_BOOL(field);
 				val = GINT_TO_POINTER(purple_request_field_bool_get_value(bfield));
 			} else if(PURPLE_IS_REQUEST_FIELD_INT(field)) {
@@ -883,15 +889,6 @@ finch_request_save_in_prefs(G_GNUC_UNUSE
 			} else if(PURPLE_IS_REQUEST_FIELD_STRING(field)) {
 				PurpleRequestFieldString *sfield = PURPLE_REQUEST_FIELD_STRING(field);
 				val = (gpointer)purple_request_field_string_get_value(sfield);
-			} else {
-			switch (type) {
-				case PURPLE_REQUEST_FIELD_LIST:
-					val = purple_request_field_list_get_selected(field)->data;
-					val = purple_request_field_list_get_data(field, val);
-					break;
-				default:
-					break;
-			}
 			}
 
 			pt = purple_prefs_get_pref_type(id);
@@ -899,7 +896,7 @@ finch_request_save_in_prefs(G_GNUC_UNUSE
 				case PURPLE_PREF_INT:
 				{
 					long int tmp = GPOINTER_TO_INT(val);
-					if (type == PURPLE_REQUEST_FIELD_LIST) {
+					if(PURPLE_IS_REQUEST_FIELD_LIST(field)) {
 						/* Lists always return string */
 						if (sscanf(val, "%ld", &tmp) != 1)
 							tmp = 0;
@@ -933,16 +930,11 @@ GntWidget *finch_request_field_get_widge
 		ret = create_choice_field(field);
 	} else if(PURPLE_IS_REQUEST_FIELD_ACCOUNT(field)) {
 		ret = create_account_field(field);
+	} else if(PURPLE_IS_REQUEST_FIELD_LIST(field)) {
+		ret = create_list_field(field);
 	} else {
-	switch (purple_request_field_get_field_type(field)) {
-		case PURPLE_REQUEST_FIELD_LIST:
-			ret = create_list_field(field);
-			break;
-		default:
-			purple_debug_error("GntRequest", "Unimplemented request-field %d\n",
-					purple_request_field_get_field_type(field));
-			break;
-	}
+		purple_debug_error("GntRequest", "Unimplemented request-field %s",
+		                   G_OBJECT_TYPE_NAME(field));
 	}
 	return ret;
 }
diff --git a/libpurple/meson.build b/libpurple/meson.build
--- a/libpurple/meson.build
+++ b/libpurple/meson.build
@@ -101,6 +101,7 @@ purple_coresources = [
 	'request/purplerequestfieldbool.c',
 	'request/purplerequestfieldchoice.c',
 	'request/purplerequestfieldint.c',
+	'request/purplerequestfieldlist.c',
 	'request/purplerequestfieldstring.c',
 	'request-datasheet.c',
 	'roomlist.c',
@@ -229,6 +230,7 @@ purple_request_headers = [
 	'request/purplerequestfieldbool.h',
 	'request/purplerequestfieldchoice.h',
 	'request/purplerequestfieldint.h',
+	'request/purplerequestfieldlist.h',
 	'request/purplerequestfieldstring.h',
 ]
 
diff --git a/libpurple/protocols/demo/purpledemoprotocolactions.c b/libpurple/protocols/demo/purpledemoprotocolactions.c
--- a/libpurple/protocols/demo/purpledemoprotocolactions.c
+++ b/libpurple/protocols/demo/purpledemoprotocolactions.c
@@ -370,7 +370,7 @@ purple_demo_protocol_request_fields_ok_c
                                           PurpleRequestPage *page)
 {
 	PurpleAccount *account = NULL;
-	PurpleRequestField *field = NULL;
+	PurpleRequestFieldList *field = NULL;
 	GList *list = NULL;
 	const char *tmp = NULL;
 	GString *info = NULL;
@@ -401,7 +401,8 @@ purple_demo_protocol_request_fields_ok_c
 	tmp = (const char *)purple_request_page_get_choice(page, "choice");
 	g_string_append_printf(info, _("\tChoice: %s\n"), tmp);
 
-	field = purple_request_page_get_field(page, "list");
+	field = PURPLE_REQUEST_FIELD_LIST(purple_request_page_get_field(page,
+	                                                                "list"));
 	list = purple_request_field_list_get_selected(field);
 	if(list != NULL) {
 		tmp = (const char *)list->data;
@@ -410,7 +411,8 @@ purple_demo_protocol_request_fields_ok_c
 	}
 	g_string_append_printf(info, _("\tList: %s\n"), tmp);
 
-	field = purple_request_page_get_field(page, "multilist");
+	field = PURPLE_REQUEST_FIELD_LIST(purple_request_page_get_field(page,
+	                                                                "multilist"));
 	list = purple_request_field_list_get_selected(field);
 	g_string_append(info, _("\tMulti-list: ["));
 	while(list != NULL) {
@@ -456,6 +458,7 @@ purple_demo_protocol_request_fields_acti
 	PurpleRequestGroup *group = NULL;
 	PurpleRequestField *field = NULL;
 	PurpleRequestFieldChoice *choice_field = NULL;
+	PurpleRequestFieldList *list_field = NULL;
 	GBytes *icon = NULL;
 	gconstpointer icon_data = NULL;
 	gsize icon_len = 0;
@@ -529,18 +532,20 @@ purple_demo_protocol_request_fields_acti
 	purple_request_group_add_field(group, field);
 
 	field = purple_request_field_list_new("list", _("A list"));
-	purple_request_field_list_add_icon(field, _("foo"), NULL, "foo");
-	purple_request_field_list_add_icon(field, _("bar"), NULL, "bar");
-	purple_request_field_list_add_icon(field, _("baz"), NULL, "baz");
-	purple_request_field_list_add_icon(field, _("quux"), NULL, "quux");
+	list_field = PURPLE_REQUEST_FIELD_LIST(field);
+	purple_request_field_list_add_icon(list_field, _("foo"), NULL, "foo");
+	purple_request_field_list_add_icon(list_field, _("bar"), NULL, "bar");
+	purple_request_field_list_add_icon(list_field, _("baz"), NULL, "baz");
+	purple_request_field_list_add_icon(list_field, _("quux"), NULL, "quux");
 	purple_request_group_add_field(group, field);
 
 	field = purple_request_field_list_new("multilist", _("A multi-select list"));
-	purple_request_field_list_set_multi_select(field, TRUE);
-	purple_request_field_list_add_icon(field, _("foo"), NULL, "foo");
-	purple_request_field_list_add_icon(field, _("bar"), NULL, "bar");
-	purple_request_field_list_add_icon(field, _("baz"), NULL, "baz");
-	purple_request_field_list_add_icon(field, _("quux"), NULL, "quux");
+	list_field = PURPLE_REQUEST_FIELD_LIST(field);
+	purple_request_field_list_set_multi_select(list_field, TRUE);
+	purple_request_field_list_add_icon(list_field, _("foo"), NULL, "foo");
+	purple_request_field_list_add_icon(list_field, _("bar"), NULL, "bar");
+	purple_request_field_list_add_icon(list_field, _("baz"), NULL, "baz");
+	purple_request_field_list_add_icon(list_field, _("quux"), NULL, "quux");
 	purple_request_group_add_field(group, field);
 
 	/* This group will contain specialized fields. */
diff --git a/libpurple/protocols/facebook/util.c b/libpurple/protocols/facebook/util.c
--- a/libpurple/protocols/facebook/util.c
+++ b/libpurple/protocols/facebook/util.c
@@ -302,14 +302,15 @@ fb_util_request_buddy_ok(gpointer *reque
 	gpointer data = request_data[2];
 	GSList *ret = NULL;
 	PurpleBuddy *bdy;
-	PurpleRequestField *field;
+	PurpleRequestFieldList *field;
 
 	if (func == NULL) {
 		g_free(request_data);
 		return;
 	}
 
-	field = purple_request_page_get_field(page, "buddy");
+	field = PURPLE_REQUEST_FIELD_LIST(purple_request_page_get_field(page,
+	                                                                "buddy"));
 	select = purple_request_field_list_get_selected(field);
 
 	for (l = select; l != NULL; l = l->next) {
@@ -380,6 +381,7 @@ fb_util_request_buddy(PurpleConnection *
 	PurpleAccount *acct;
 	PurpleRequestCommonParameters *cpar;
 	PurpleRequestField *field;
+	PurpleRequestFieldList *list;
 	PurpleRequestGroup *group;
 	PurpleRequestPage *page;
 
@@ -397,7 +399,8 @@ fb_util_request_buddy(PurpleConnection *
 	purple_request_page_add_group(page, group);
 
 	field = purple_request_field_list_new("buddy", NULL);
-	purple_request_field_list_set_multi_select(field, multi);
+	list = PURPLE_REQUEST_FIELD_LIST(field);
+	purple_request_field_list_set_multi_select(list, multi);
 	purple_request_field_set_required(field, TRUE);
 	purple_request_group_add_field(group, field);
 
@@ -405,7 +408,7 @@ fb_util_request_buddy(PurpleConnection *
 		name = purple_buddy_get_name(l->data);
 		alias = purple_buddy_get_alias(l->data);
 		str = g_strdup_printf("%s (%s)", alias, name);
-		purple_request_field_list_add_icon(field, str, NULL, l->data);
+		purple_request_field_list_add_icon(list, str, NULL, l->data);
 		g_free(str);
 	}
 
@@ -416,7 +419,7 @@ fb_util_request_buddy(PurpleConnection *
 		items = g_list_append(items, str);
 	}
 
-	purple_request_field_list_set_selected(field, items);
+	purple_request_field_list_set_selected(list, items);
 	g_slist_free(buddies);
 	g_list_free_full(items, g_free);
 
diff --git a/libpurple/protocols/jabber/xdata.c b/libpurple/protocols/jabber/xdata.c
--- a/libpurple/protocols/jabber/xdata.c
+++ b/libpurple/protocols/jabber/xdata.c
@@ -116,13 +116,14 @@ jabber_x_data_ok_cb(struct jabber_x_data
 				case JABBER_X_DATA_LIST_SINGLE:
 				case JABBER_X_DATA_LIST_MULTI:
 					{
-					GList *selected = purple_request_field_list_get_selected(field);
+					PurpleRequestFieldList *lfield = PURPLE_REQUEST_FIELD_LIST(field);
+					GList *selected = purple_request_field_list_get_selected(lfield);
 					char *value;
 					fieldnode = purple_xmlnode_new_child(result, "field");
 					purple_xmlnode_set_attrib(fieldnode, "var", id);
 
 					while(selected) {
-						value = purple_request_field_list_get_data(field, selected->data);
+						value = purple_request_field_list_get_data(lfield, selected->data);
 						valuenode = purple_xmlnode_new_child(fieldnode, "value");
 						if(value)
 							purple_xmlnode_insert_data(valuenode, value, -1);
@@ -265,13 +266,15 @@ void *jabber_x_data_request_with_actions
 
 			g_string_free(str, TRUE);
 		} else if(purple_strequal(type, "list-single") || purple_strequal(type, "list-multi")) {
+			PurpleRequestFieldList *list_field = NULL;
 			PurpleXmlNode *optnode;
 			GList *selected = NULL;
 
 			field = purple_request_field_list_new(var, label);
+			list_field = PURPLE_REQUEST_FIELD_LIST(field);
 
 			if(purple_strequal(type, "list-multi")) {
-				purple_request_field_list_set_multi_select(field, TRUE);
+				purple_request_field_list_set_multi_select(list_field, TRUE);
 				g_hash_table_replace(data->fields, g_strdup(var),
 						GINT_TO_POINTER(JABBER_X_DATA_LIST_MULTI));
 			} else {
@@ -302,9 +305,10 @@ void *jabber_x_data_request_with_actions
 
 				data->values = g_slist_prepend(data->values, value);
 
-				purple_request_field_list_add_icon(field, lbl, NULL, value);
-				if(g_list_find_custom(selected, value, (GCompareFunc)strcmp))
-					purple_request_field_list_add_selected(field, lbl);
+				purple_request_field_list_add_icon(list_field, lbl, NULL, value);
+				if(g_list_find_custom(selected, value, (GCompareFunc)strcmp)) {
+					purple_request_field_list_add_selected(list_field, lbl);
+				}
 			}
 			purple_request_group_add_field(group, field);
 
diff --git a/libpurple/purplerequestfield.h b/libpurple/purplerequestfield.h
--- a/libpurple/purplerequestfield.h
+++ b/libpurple/purplerequestfield.h
@@ -64,7 +64,6 @@ struct _PurpleRequestFieldClass {
 /**
  * PurpleRequestFieldType:
  * @PURPLE_REQUEST_FIELD_NONE: No field.
- * @PURPLE_REQUEST_FIELD_LIST: List field.
  * @PURPLE_REQUEST_FIELD_LABEL: Label field.
  * @PURPLE_REQUEST_FIELD_IMAGE: Image field.
  * @PURPLE_REQUEST_FIELD_DATASHEET: Datasheet field.
@@ -74,7 +73,6 @@ struct _PurpleRequestFieldClass {
 typedef enum
 {
 	PURPLE_REQUEST_FIELD_NONE,
-	PURPLE_REQUEST_FIELD_LIST,
 	PURPLE_REQUEST_FIELD_LABEL,
 	PURPLE_REQUEST_FIELD_IMAGE,
 	PURPLE_REQUEST_FIELD_DATASHEET
@@ -311,139 +309,6 @@ void purple_request_field_set_sensitive(
 gboolean purple_request_field_is_sensitive(PurpleRequestField *field);
 
 /**************************************************************************/
-/* List Field API                                                         */
-/**************************************************************************/
-
-/**
- * purple_request_field_list_new:
- * @id:   The field ID.
- * @text: The optional label of the field.
- *
- * Creates a multiple list item field.
- *
- * Returns: (transfer full): The new field.
- */
-PurpleRequestField *purple_request_field_list_new(const char *id, const char *text);
-
-/**
- * purple_request_field_list_set_multi_select:
- * @field:        The list field.
- * @multi_select: TRUE if multiple selection is enabled,
- *                     or FALSE otherwise.
- *
- * Sets whether or not a list field allows multiple selection.
- */
-void purple_request_field_list_set_multi_select(PurpleRequestField *field,
-											  gboolean multi_select);
-
-/**
- * purple_request_field_list_get_multi_select:
- * @field: The list field.
- *
- * Returns whether or not a list field allows multiple selection.
- *
- * Returns: TRUE if multiple selection is enabled, or FALSE otherwise.
- */
-gboolean purple_request_field_list_get_multi_select(PurpleRequestField *field);
-
-/**
- * purple_request_field_list_get_data:
- * @field: The list field.
- * @text:  The item text.
- *
- * Returns the data for a particular item.
- *
- * Returns: The data associated with the item.
- */
-void *purple_request_field_list_get_data(PurpleRequestField *field, const char *text);
-
-/**
- * purple_request_field_list_add_icon:
- * @field:     The list field.
- * @item:      The list item.
- * @icon_path: The path to icon file, or %NULL for no icon.
- * @data:      The associated data.
- *
- * Adds an item to a list field.
- */
-void purple_request_field_list_add_icon(PurpleRequestField *field,
-								 const char *item, const char* icon_path, void* data);
-
-/**
- * purple_request_field_list_add_selected:
- * @field: The field.
- * @item:  The item to add.
- *
- * Adds a selected item to the list field.
- */
-void purple_request_field_list_add_selected(PurpleRequestField *field,
-										  const char *item);
-
-/**
- * purple_request_field_list_clear_selected:
- * @field: The field.
- *
- * Clears the list of selected items in a list field.
- */
-void purple_request_field_list_clear_selected(PurpleRequestField *field);
-
-/**
- * purple_request_field_list_set_selected:
- * @field: The field.
- * @items: (element-type utf8) (transfer none): The list of selected items.
- *
- * Sets a list of selected items in a list field.
- */
-void purple_request_field_list_set_selected(PurpleRequestField *field,
-										  GList *items);
-
-/**
- * purple_request_field_list_is_selected:
- * @field: The field.
- * @item:  The item.
- *
- * Returns whether or not a particular item is selected in a list field.
- *
- * Returns: TRUE if the item is selected. FALSE otherwise.
- */
-gboolean purple_request_field_list_is_selected(PurpleRequestField *field, const char *item);
-
-/**
- * purple_request_field_list_get_selected:
- * @field: The field.
- *
- * Returns a list of selected items in a list field.
- *
- * To retrieve the data for each item, use
- * purple_request_field_list_get_data().
- *
- * Returns: (element-type utf8) (transfer none): The list of selected items.
- */
-GList *purple_request_field_list_get_selected(PurpleRequestField *field);
-
-/**
- * purple_request_field_list_get_items:
- * @field: The field.
- *
- * Returns a list of items in a list field.
- *
- * Returns: (element-type PurpleKeyValuePair) (transfer none): The list of items.
- */
-GList *purple_request_field_list_get_items(PurpleRequestField *field);
-
-/**
- * purple_request_field_list_has_icons:
- * @field: The field.
- *
- * Indicates if list field has icons.
- *
- * Returns: TRUE if list field has icons, FALSE otherwise.
- *
- * Since: 3.0.0
- */
-gboolean purple_request_field_list_has_icons(PurpleRequestField *field);
-
-/**************************************************************************/
 /* Label Field API                                                        */
 /**************************************************************************/
 
diff --git a/libpurple/purplerequestfield.h b/libpurple/request/purplerequestfieldlist.h
copy from libpurple/purplerequestfield.h
copy to libpurple/request/purplerequestfieldlist.h
--- a/libpurple/purplerequestfield.h
+++ b/libpurple/request/purplerequestfieldlist.h
@@ -24,8 +24,8 @@
 # error "only <purple.h> may be included directly"
 #endif
 
-#ifndef PURPLE_REQUEST_FIELD_H
-#define PURPLE_REQUEST_FIELD_H
+#ifndef PURPLE_REQUEST_FIELD_LIST_H
+#define PURPLE_REQUEST_FIELD_LIST_H
 
 #include <stdlib.h>
 
@@ -33,286 +33,19 @@
 #include <glib-object.h>
 
 /**
- * PurpleRequestField:
+ * PurpleRequestFieldList:
  *
- * A request field.
+ * A list request field.
  */
-typedef struct _PurpleRequestField PurpleRequestField;
-
-#include "request.h"
-#include "request-datasheet.h"
-
-#define PURPLE_DEFAULT_ACTION_NONE	-1
-
-/**
- * PurpleRequestFieldClass:
- *
- * #PurpleRequestFieldClass defines the interface for a request field.
- *
- * Since: 3.0.0
- */
-struct _PurpleRequestFieldClass {
-	/*< private >*/
-	GObjectClass parent_class;
-
-	/*< public >*/
+typedef struct _PurpleRequestFieldList PurpleRequestFieldList;
 
-	/*< private >*/
-	gpointer reserved[4];
-};
-
-/**
- * PurpleRequestFieldType:
- * @PURPLE_REQUEST_FIELD_NONE: No field.
- * @PURPLE_REQUEST_FIELD_LIST: List field.
- * @PURPLE_REQUEST_FIELD_LABEL: Label field.
- * @PURPLE_REQUEST_FIELD_IMAGE: Image field.
- * @PURPLE_REQUEST_FIELD_DATASHEET: Datasheet field.
- *
- * A type of field.
- */
-typedef enum
-{
-	PURPLE_REQUEST_FIELD_NONE,
-	PURPLE_REQUEST_FIELD_LIST,
-	PURPLE_REQUEST_FIELD_LABEL,
-	PURPLE_REQUEST_FIELD_IMAGE,
-	PURPLE_REQUEST_FIELD_DATASHEET
-
-} PurpleRequestFieldType;
-
-typedef gboolean (*PurpleRequestFieldValidator)(PurpleRequestField *field,
-	gchar **errmsg, gpointer user_data);
+#include "purplerequestfield.h"
 
 G_BEGIN_DECLS
 
-/**************************************************************************/
-/* Field API                                                              */
-/**************************************************************************/
-
-#define PURPLE_TYPE_REQUEST_FIELD (purple_request_field_get_type())
-G_DECLARE_DERIVABLE_TYPE(PurpleRequestField, purple_request_field,
-                         PURPLE, REQUEST_FIELD, GObject)
-
-/**
- * purple_request_field_new:
- * @id:   The field ID.
- * @text: The text label of the field.
- * @type: The type of field.
- *
- * Creates a field of the specified type.
- *
- * Returns: (transfer full): The new field.
- */
-PurpleRequestField *purple_request_field_new(const char *id, const char *text,
-										 PurpleRequestFieldType type);
-
-/**
- * purple_request_field_set_label:
- * @field: The field.
- * @label: The text label.
- *
- * Sets the label text of a field.
- */
-void purple_request_field_set_label(PurpleRequestField *field, const char *label);
-
-/**
- * purple_request_field_set_visible:
- * @field:   The field.
- * @visible: TRUE if visible, or FALSE if not.
- *
- * Sets whether or not a field is visible.
- */
-void purple_request_field_set_visible(PurpleRequestField *field, gboolean visible);
-
-/**
- * purple_request_field_set_type_hint:
- * @field:     The field.
- * @type_hint: The type hint.
- *
- * Sets the type hint for the field.
- *
- * This is optionally used by the UIs to provide such features as
- * auto-completion for type hints like "account" and "screenname".
- */
-void purple_request_field_set_type_hint(PurpleRequestField *field,
-									  const char *type_hint);
-
-/**
- * purple_request_field_set_tooltip:
- * @field:     The field.
- * @tooltip:   The tooltip text.
- *
- * Sets the tooltip for the field.
- *
- * This is optionally used by the UIs to provide a tooltip for
- * the field.
- */
-void purple_request_field_set_tooltip(PurpleRequestField *field,
-									const char *tooltip);
-
-/**
- * purple_request_field_set_required:
- * @field:    The field.
- * @required: TRUE if required, or FALSE.
- *
- * Sets whether or not a field is required.
- */
-void purple_request_field_set_required(PurpleRequestField *field,
-									 gboolean required);
-
-/**
- * purple_request_field_get_field_type:
- * @field: The field.
- *
- * Returns the type of a field.
- *
- * Returns: The field's type.
- */
-PurpleRequestFieldType purple_request_field_get_field_type(PurpleRequestField *field);
-
-/**
- * purple_request_field_get_group:
- * @field: The field.
- *
- * Returns the group for the field.
- *
- * Returns: (transfer none): The UI data.
- */
-PurpleRequestGroup *purple_request_field_get_group(PurpleRequestField *field);
-
-/**
- * purple_request_field_get_id:
- * @field: The field.
- *
- * Returns the ID of a field.
- *
- * Returns: The ID
- */
-const char *purple_request_field_get_id(PurpleRequestField *field);
-
-/**
- * purple_request_field_get_label:
- * @field: The field.
- *
- * Returns the label text of a field.
- *
- * Returns: The label text.
- */
-const char *purple_request_field_get_label(PurpleRequestField *field);
-
-/**
- * purple_request_field_is_visible:
- * @field: The field.
- *
- * Returns whether or not a field is visible.
- *
- * Returns: TRUE if the field is visible. FALSE otherwise.
- */
-gboolean purple_request_field_is_visible(PurpleRequestField *field);
-
-/**
- * purple_request_field_get_type_hint:
- * @field: The field.
- *
- * Returns the field's type hint.
- *
- * Returns: The field's type hint.
- */
-const char *purple_request_field_get_type_hint(PurpleRequestField *field);
-
-/**
- * purple_request_field_get_tooltip:
- * @field: The field.
- *
- * Returns the field's tooltip.
- *
- * Returns: The field's tooltip.
- */
-const char *purple_request_field_get_tooltip(PurpleRequestField *field);
-
-/**
- * purple_request_field_is_required:
- * @field: The field.
- *
- * Returns whether or not a field is required.
- *
- * Returns: TRUE if the field is required, or FALSE.
- */
-gboolean purple_request_field_is_required(PurpleRequestField *field);
-
-/**
- * purple_request_field_is_filled:
- * @field: The field.
- *
- * Checks, if specified field has value.
- *
- * Returns: TRUE if the field has value, or FALSE.
- */
-gboolean purple_request_field_is_filled(PurpleRequestField *field);
-
-/**
- * purple_request_field_set_validator:
- * @field:     The field.
- * @validator: (scope notified): The validator callback, NULL to disable validation.
- * @user_data: The data to pass to the callback.
- *
- * Sets validator for a single field.
- */
-void purple_request_field_set_validator(PurpleRequestField *field,
-	PurpleRequestFieldValidator validator, void *user_data);
-
-/**
- * purple_request_field_is_validatable:
- * @field: The field.
- *
- * Returns whether or not field has validator set.
- *
- * Returns: TRUE if the field has validator, or FALSE.
- */
-gboolean purple_request_field_is_validatable(PurpleRequestField *field);
-
-/**
- * purple_request_field_is_valid:
- * @field:  The field.
- * @errmsg: If non-NULL, the memory area, where the pointer to validation
- *         failure message will be set.
- *
- * Checks, if specified field is valid.
- *
- * If detailed message about failure reason is needed, there is an option to
- * return (via errmsg argument) pointer to newly allocated error message.
- * It must be freed with g_free after use.
- *
- * Note: empty, not required fields are valid.
- *
- * Returns: TRUE, if the field is valid, FALSE otherwise.
- */
-gboolean purple_request_field_is_valid(PurpleRequestField *field, gchar **errmsg);
-
-/**
- * purple_request_field_set_sensitive:
- * @field:     The field.
- * @sensitive: TRUE if the field should be sensitive for user input.
- *
- * Sets field editable.
- */
-void purple_request_field_set_sensitive(PurpleRequestField *field,
-	gboolean sensitive);
-
-/**
- * purple_request_field_is_sensitive:
- * @field: The field.
- *
- * Checks, if field is editable.
- *
- * Returns: TRUE, if the field is sensitive for user input.
- */
-gboolean purple_request_field_is_sensitive(PurpleRequestField *field);
-
-/**************************************************************************/
-/* List Field API                                                         */
-/**************************************************************************/
+#define PURPLE_TYPE_REQUEST_FIELD_LIST (purple_request_field_list_get_type())
+G_DECLARE_FINAL_TYPE(PurpleRequestFieldList, purple_request_field_list,
+                     PURPLE, REQUEST_FIELD_LIST, PurpleRequestField)
 
 /**
  * purple_request_field_list_new:
@@ -333,8 +66,7 @@ PurpleRequestField *purple_request_field
  *
  * Sets whether or not a list field allows multiple selection.
  */
-void purple_request_field_list_set_multi_select(PurpleRequestField *field,
-											  gboolean multi_select);
+void purple_request_field_list_set_multi_select(PurpleRequestFieldList *field, gboolean multi_select);
 
 /**
  * purple_request_field_list_get_multi_select:
@@ -344,7 +76,7 @@ void purple_request_field_list_set_multi
  *
  * Returns: TRUE if multiple selection is enabled, or FALSE otherwise.
  */
-gboolean purple_request_field_list_get_multi_select(PurpleRequestField *field);
+gboolean purple_request_field_list_get_multi_select(PurpleRequestFieldList *field);
 
 /**
  * purple_request_field_list_get_data:
@@ -355,7 +87,7 @@ gboolean purple_request_field_list_get_m
  *
  * Returns: The data associated with the item.
  */
-void *purple_request_field_list_get_data(PurpleRequestField *field, const char *text);
+gpointer purple_request_field_list_get_data(PurpleRequestFieldList *field, const char *text);
 
 /**
  * purple_request_field_list_add_icon:
@@ -366,8 +98,7 @@ void *purple_request_field_list_get_data
  *
  * Adds an item to a list field.
  */
-void purple_request_field_list_add_icon(PurpleRequestField *field,
-								 const char *item, const char* icon_path, void* data);
+void purple_request_field_list_add_icon(PurpleRequestFieldList *field, const char *item, const char *icon_path, gpointer data);
 
 /**
  * purple_request_field_list_add_selected:
@@ -376,8 +107,7 @@ void purple_request_field_list_add_icon(
  *
  * Adds a selected item to the list field.
  */
-void purple_request_field_list_add_selected(PurpleRequestField *field,
-										  const char *item);
+void purple_request_field_list_add_selected(PurpleRequestFieldList *field, const char *item);
 
 /**
  * purple_request_field_list_clear_selected:
@@ -385,7 +115,7 @@ void purple_request_field_list_add_selec
  *
  * Clears the list of selected items in a list field.
  */
-void purple_request_field_list_clear_selected(PurpleRequestField *field);
+void purple_request_field_list_clear_selected(PurpleRequestFieldList *field);
 
 /**
  * purple_request_field_list_set_selected:
@@ -394,8 +124,7 @@ void purple_request_field_list_clear_sel
  *
  * Sets a list of selected items in a list field.
  */
-void purple_request_field_list_set_selected(PurpleRequestField *field,
-										  GList *items);
+void purple_request_field_list_set_selected(PurpleRequestFieldList *field, GList *items);
 
 /**
  * purple_request_field_list_is_selected:
@@ -406,7 +135,7 @@ void purple_request_field_list_set_selec
  *
  * Returns: TRUE if the item is selected. FALSE otherwise.
  */
-gboolean purple_request_field_list_is_selected(PurpleRequestField *field, const char *item);
+gboolean purple_request_field_list_is_selected(PurpleRequestFieldList *field, const char *item);
 
 /**
  * purple_request_field_list_get_selected:
@@ -419,7 +148,7 @@ gboolean purple_request_field_list_is_se
  *
  * Returns: (element-type utf8) (transfer none): The list of selected items.
  */
-GList *purple_request_field_list_get_selected(PurpleRequestField *field);
+GList *purple_request_field_list_get_selected(PurpleRequestFieldList *field);
 
 /**
  * purple_request_field_list_get_items:
@@ -429,7 +158,7 @@ GList *purple_request_field_list_get_sel
  *
  * Returns: (element-type PurpleKeyValuePair) (transfer none): The list of items.
  */
-GList *purple_request_field_list_get_items(PurpleRequestField *field);
+GList *purple_request_field_list_get_items(PurpleRequestFieldList *field);
 
 /**
  * purple_request_field_list_has_icons:
@@ -441,155 +170,8 @@ GList *purple_request_field_list_get_ite
  *
  * Since: 3.0.0
  */
-gboolean purple_request_field_list_has_icons(PurpleRequestField *field);
-
-/**************************************************************************/
-/* Label Field API                                                        */
-/**************************************************************************/
-
-/**
- * purple_request_field_label_new:
- * @id:   The field ID.
- * @text: The label of the field.
- *
- * Creates a label field.
- *
- * Returns: (transfer full): The new field.
- */
-PurpleRequestField *purple_request_field_label_new(const char *id,
-											   const char *text);
-
-/**************************************************************************/
-/* Image Field API                                                        */
-/**************************************************************************/
-
-/**
- * purple_request_field_image_new:
- * @id:   The field ID.
- * @text: The label of the field.
- * @buf:  The image data.
- * @size: The size of the data in @buf.
- *
- * Creates an image field.
- *
- * Returns: (transfer full): The new field.
- */
-PurpleRequestField *purple_request_field_image_new(const char *id, const char *text,
-											   const char *buf, gsize size);
-
-/**
- * purple_request_field_image_set_scale:
- * @field: The image field.
- * @x:     The x scale factor.
- * @y:     The y scale factor.
- *
- * Sets the scale factors of an image field.
- */
-void purple_request_field_image_set_scale(PurpleRequestField *field, unsigned int x, unsigned int y);
-
-/**
- * purple_request_field_image_get_buffer:
- * @field: The image field.
- *
- * Returns pointer to the image.
- *
- * Returns: Pointer to the image.
- */
-const char *purple_request_field_image_get_buffer(PurpleRequestField *field);
-
-/**
- * purple_request_field_image_get_size:
- * @field: The image field.
- *
- * Returns size (in bytes) of the image.
- *
- * Returns: Size of the image.
- */
-gsize purple_request_field_image_get_size(PurpleRequestField *field);
-
-/**
- * purple_request_field_image_get_scale_x:
- * @field: The image field.
- *
- * Returns X scale coefficient of the image.
- *
- * Returns: X scale coefficient of the image.
- */
-unsigned int purple_request_field_image_get_scale_x(PurpleRequestField *field);
-
-/**
- * purple_request_field_image_get_scale_y:
- * @field: The image field.
- *
- * Returns Y scale coefficient of the image.
- *
- * Returns: Y scale coefficient of the image.
- */
-unsigned int purple_request_field_image_get_scale_y(PurpleRequestField *field);
-
-/**************************************************************************/
-/* Datasheet Field API                                                    */
-/**************************************************************************/
-
-/**
- * purple_request_field_datasheet_new:
- * @id:    The field ID.
- * @text:  The label of the field, may be %NULL.
- * @sheet: The datasheet.
- *
- * Creates a datasheet item field.
- *
- * Returns: (transfer full): The new field.
- */
-PurpleRequestField *purple_request_field_datasheet_new(const char *id,
-	const gchar *text, PurpleRequestDatasheet *sheet);
-
-/**
- * purple_request_field_datasheet_get_sheet:
- * @field: The field.
- *
- * Returns a datasheet for a field.
- *
- * Returns: (transfer none): The datasheet object.
- */
-PurpleRequestDatasheet *purple_request_field_datasheet_get_sheet(
-	PurpleRequestField *field);
-
-/**************************************************************************/
-/* Validators for request fields.                                         */
-/**************************************************************************/
-
-/**
- * purple_request_field_email_validator:
- * @field: The field.
- * @errmsg: (out) (optional): destination for error message.
- * @user_data: Ignored.
- *
- * Validates a field which should contain an email address.
- *
- * See purple_request_field_set_validator().
- *
- * Returns: TRUE, if field contains valid email address.
- */
-gboolean purple_request_field_email_validator(PurpleRequestField *field,
-	gchar **errmsg, void *user_data);
-
-/**
- * purple_request_field_alphanumeric_validator:
- * @field: The field.
- * @errmsg: (allow-none): destination for error message.
- * @allowed_characters: (allow-none): allowed character list
- *                      (NULL-terminated string).
- *
- * Validates a field which should contain alphanumeric content.
- *
- * See purple_request_field_set_validator().
- *
- * Returns: TRUE, if field contains only alphanumeric characters.
- */
-gboolean purple_request_field_alphanumeric_validator(PurpleRequestField *field,
-	gchar **errmsg, void *allowed_characters);
+gboolean purple_request_field_list_has_icons(PurpleRequestFieldList *field);
 
 G_END_DECLS
 
-#endif /* PURPLE_REQUEST_FIELD_H */
+#endif /* PURPLE_REQUEST_FIELD_LIST_H */
diff --git a/libpurple/purplerequestfield.c b/libpurple/purplerequestfield.c
--- a/libpurple/purplerequestfield.c
+++ b/libpurple/purplerequestfield.c
@@ -42,16 +42,6 @@ typedef struct {
 
 	union {
 		struct {
-			GList *items;
-			gboolean has_icons;
-			GHashTable *item_data;
-			GList *selected;
-			GHashTable *selected_table;
-
-			gboolean multiple_selection;
-		} list;
-
-		struct {
 			unsigned int scale_x;
 			unsigned int scale_y;
 			char *buffer;
@@ -206,13 +196,7 @@ purple_request_field_finalize(GObject *o
 	g_free(priv->type_hint);
 	g_free(priv->tooltip);
 
-	if(priv->type == PURPLE_REQUEST_FIELD_LIST) {
-		g_list_free_full(priv->u.list.items,
-		                 (GDestroyNotify)purple_key_value_pair_free);
-		g_list_free_full(priv->u.list.selected, g_free);
-		g_hash_table_destroy(priv->u.list.item_data);
-		g_hash_table_destroy(priv->u.list.selected_table);
-	} else if(priv->type == PURPLE_REQUEST_FIELD_DATASHEET) {
+	if(priv->type == PURPLE_REQUEST_FIELD_DATASHEET) {
 		purple_request_datasheet_free(priv->u.datasheet.sheet);
 	} else if(priv->type == PURPLE_REQUEST_FIELD_IMAGE) {
 		g_free(priv->u.image.buffer);
@@ -651,212 +635,6 @@ purple_request_field_is_sensitive(Purple
 }
 
 PurpleRequestField *
-purple_request_field_list_new(const char *id, const char *text)
-{
-	PurpleRequestField *field;
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(id   != NULL, NULL);
-
-	field = purple_request_field_new(id, text, PURPLE_REQUEST_FIELD_LIST);
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->u.list.item_data = g_hash_table_new_full(g_str_hash, g_str_equal,
-	                                               g_free, NULL);
-
-	priv->u.list.selected_table = g_hash_table_new_full(g_str_hash, g_str_equal,
-	                                                    g_free, NULL);
-
-	return field;
-}
-
-void
-purple_request_field_list_set_multi_select(PurpleRequestField *field,
-										 gboolean multi_select)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST);
-
-	priv->u.list.multiple_selection = multi_select;
-}
-
-gboolean
-purple_request_field_list_get_multi_select(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, FALSE);
-
-	return priv->u.list.multiple_selection;
-}
-
-void *
-purple_request_field_list_get_data(PurpleRequestField *field, const char *text)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-	g_return_val_if_fail(text  != NULL, NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, NULL);
-
-	return g_hash_table_lookup(priv->u.list.item_data, text);
-}
-
-void
-purple_request_field_list_add_icon(PurpleRequestField *field, const char *item, const char* icon_path,
-							void *data)
-{
-	PurpleKeyValuePair *kvp;
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-	g_return_if_fail(item  != NULL);
-	g_return_if_fail(data  != NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST);
-
-	priv->u.list.has_icons = priv->u.list.has_icons || (icon_path != NULL);
-	kvp = purple_key_value_pair_new_full(item, g_strdup(icon_path), g_free);
-	priv->u.list.items = g_list_append(priv->u.list.items, kvp);
-	g_hash_table_insert(priv->u.list.item_data, g_strdup(item), data);
-}
-
-void
-purple_request_field_list_add_selected(PurpleRequestField *field, const char *item)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-	g_return_if_fail(item  != NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST);
-
-	if(!purple_request_field_list_get_multi_select(field) &&
-	   priv->u.list.selected != NULL)
-	{
-		purple_debug_warning("request",
-						   "More than one item added to non-multi-select "
-						   "field %s\n",
-						   purple_request_field_get_id(field));
-		return;
-	}
-
-	priv->u.list.selected = g_list_append(priv->u.list.selected,
-	                                      g_strdup(item));
-
-	g_hash_table_add(priv->u.list.selected_table, g_strdup(item));
-}
-
-void
-purple_request_field_list_clear_selected(PurpleRequestField *field)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST);
-
-	if(priv->u.list.selected != NULL) {
-		g_list_free_full(priv->u.list.selected, g_free);
-		priv->u.list.selected = NULL;
-	}
-
-	g_hash_table_remove_all(priv->u.list.selected_table);
-}
-
-void
-purple_request_field_list_set_selected(PurpleRequestField *field, GList *items)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-	GList *l;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-	g_return_if_fail(items != NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST);
-
-	purple_request_field_list_clear_selected(field);
-
-	if (!purple_request_field_list_get_multi_select(field) && items->next) {
-		purple_debug_warning("request",
-						   "More than one item added to non-multi-select "
-						   "field %s\n",
-						   purple_request_field_get_id(field));
-		return;
-	}
-
-	for (l = items; l != NULL; l = l->next) {
-		char *selected = l->data;
-		priv->u.list.selected = g_list_append(priv->u.list.selected,
-		                                      g_strdup(selected));
-		g_hash_table_add(priv->u.list.selected_table, g_strdup(selected));
-	}
-}
-
-gboolean
-purple_request_field_list_is_selected(PurpleRequestField *field,
-                                      const char *item)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-	g_return_val_if_fail(item  != NULL, FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, FALSE);
-
-	return g_hash_table_contains(priv->u.list.selected_table, item);
-}
-
-GList *
-purple_request_field_list_get_selected(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, NULL);
-
-	return priv->u.list.selected;
-}
-
-GList *
-purple_request_field_list_get_items(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, NULL);
-
-	return priv->u.list.items;
-}
-
-gboolean
-purple_request_field_list_has_icons(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, FALSE);
-
-	return priv->u.list.has_icons;
-}
-
-PurpleRequestField *
 purple_request_field_label_new(const char *id, const char *text)
 {
 	PurpleRequestField *field;
diff --git a/libpurple/purplerequestfield.c b/libpurple/request/purplerequestfieldlist.c
copy from libpurple/purplerequestfield.c
copy to libpurple/request/purplerequestfieldlist.c
--- a/libpurple/purplerequestfield.c
+++ b/libpurple/request/purplerequestfieldlist.c
@@ -22,133 +22,46 @@
 #include <glib/gi18n-lib.h>
 
 #include "glibcompat.h"
-#include "request.h"
-#include "request/purplerequestfieldstring.h"
+#include "purplerequestfield.h"
+#include "request/purplerequestfieldlist.h"
 #include "debug.h"
 #include "purplekeyvaluepair.h"
-#include "purpleprivate.h"
 
-typedef struct {
-	PurpleRequestFieldType type;
-	PurpleRequestGroup *group;
-
-	char *id;
-	char *label;
-	char *type_hint;
-
-	gboolean visible;
-	gboolean required;
-	gboolean sensitive;
-
-	union {
-		struct {
-			GList *items;
-			gboolean has_icons;
-			GHashTable *item_data;
-			GList *selected;
-			GHashTable *selected_table;
+struct _PurpleRequestFieldList {
+	PurpleRequestField parent;
 
-			gboolean multiple_selection;
-		} list;
-
-		struct {
-			unsigned int scale_x;
-			unsigned int scale_y;
-			char *buffer;
-			gsize size;
-		} image;
+	GList *items;
+	gboolean has_icons;
+	GHashTable *item_data;
+	GList *selected;
+	GHashTable *selected_table;
 
-		struct {
-			PurpleRequestDatasheet *sheet;
-		} datasheet;
-	} u;
-
-	void *ui_data;
-	char *tooltip;
-
-	PurpleRequestFieldValidator validator;
-	void *validator_data;
-} PurpleRequestFieldPrivate;
+	gboolean multiple_selection;
+};
 
 enum {
 	PROP_0,
-	PROP_ID,
-	PROP_LABEL,
-	PROP_VISIBLE,
-	PROP_SENSITIVE,
-	PROP_TYPE_HINT,
-	PROP_TOOLTIP,
-	PROP_REQUIRED,
-	PROP_IS_VALIDATABLE,
+	PROP_MULTI_SELECT,
 	N_PROPERTIES,
 };
 static GParamSpec *properties[N_PROPERTIES] = {NULL, };
 
-G_DEFINE_TYPE_WITH_PRIVATE(PurpleRequestField, purple_request_field, G_TYPE_OBJECT)
-
-/******************************************************************************
- * Helpers
- *****************************************************************************/
-static void
-purple_request_field_set_id(PurpleRequestField *field, const char *id) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	priv = purple_request_field_get_instance_private(field);
-
-	g_free(priv->id);
-	priv->id = g_strdup(id);
-
-	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_ID]);
-}
-
-static void
-purple_request_field_set_field_type(PurpleRequestField *field,
-                                    PurpleRequestFieldType type)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->type = type;
-}
-
 /******************************************************************************
  * GObject Implementation
  *****************************************************************************/
+G_DEFINE_TYPE(PurpleRequestFieldList, purple_request_field_list,
+              PURPLE_TYPE_REQUEST_FIELD)
+
 static void
-purple_request_field_get_property(GObject *obj, guint param_id, GValue *value,
+purple_request_field_list_get_property(GObject *obj, guint param_id, GValue *value,
                                   GParamSpec *pspec)
 {
-	PurpleRequestField *field = PURPLE_REQUEST_FIELD(obj);
+	PurpleRequestFieldList *field = PURPLE_REQUEST_FIELD_LIST(obj);
 
 	switch(param_id) {
-		case PROP_ID:
-			g_value_set_string(value, purple_request_field_get_id(field));
-			break;
-		case PROP_LABEL:
-			g_value_set_string(value, purple_request_field_get_label(field));
-			break;
-		case PROP_VISIBLE:
-			g_value_set_boolean(value, purple_request_field_is_visible(field));
-			break;
-		case PROP_SENSITIVE:
+		case PROP_MULTI_SELECT:
 			g_value_set_boolean(value,
-			                    purple_request_field_is_sensitive(field));
-			break;
-		case PROP_TYPE_HINT:
-			g_value_set_string(value,
-			                   purple_request_field_get_type_hint(field));
-			break;
-		case PROP_TOOLTIP:
-			g_value_set_string(value, purple_request_field_get_tooltip(field));
-			break;
-		case PROP_REQUIRED:
-			g_value_set_boolean(value,
-			                    purple_request_field_is_required(field));
-			break;
-		case PROP_IS_VALIDATABLE:
-			g_value_set_boolean(value,
-			                    purple_request_field_is_validatable(field));
+			                    purple_request_field_list_get_multi_select(field));
 			break;
 		default:
 			G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
@@ -157,36 +70,15 @@ purple_request_field_get_property(GObjec
 }
 
 static void
-purple_request_field_set_property(GObject *obj, guint param_id,
+purple_request_field_list_set_property(GObject *obj, guint param_id,
                                   const GValue *value, GParamSpec *pspec)
 {
-	PurpleRequestField *field = PURPLE_REQUEST_FIELD(obj);
+	PurpleRequestFieldList *field = PURPLE_REQUEST_FIELD_LIST(obj);
 
 	switch(param_id) {
-		case PROP_ID:
-			purple_request_field_set_id(field, g_value_get_string(value));
-			break;
-		case PROP_LABEL:
-			purple_request_field_set_label(field, g_value_get_string(value));
-			break;
-		case PROP_VISIBLE:
-			purple_request_field_set_visible(field,
-			                                 g_value_get_boolean(value));
-			break;
-		case PROP_SENSITIVE:
-			purple_request_field_set_sensitive(field,
-			                                   g_value_get_boolean(value));
-			break;
-		case PROP_TYPE_HINT:
-			purple_request_field_set_type_hint(field,
-			                                   g_value_get_string(value));
-			break;
-		case PROP_TOOLTIP:
-			purple_request_field_set_tooltip(field, g_value_get_string(value));
-			break;
-		case PROP_REQUIRED:
-			purple_request_field_set_required(field,
-			                                  g_value_get_boolean(value));
+		case PROP_MULTI_SELECT:
+			purple_request_field_list_set_multi_select(field,
+			                                           g_value_get_boolean(value));
 			break;
 		default:
 			G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
@@ -195,154 +87,47 @@ purple_request_field_set_property(GObjec
 }
 
 static void
-purple_request_field_finalize(GObject *obj) {
-	PurpleRequestField *field = PURPLE_REQUEST_FIELD(obj);
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	priv = purple_request_field_get_instance_private(field);
-
-	g_free(priv->id);
-	g_free(priv->label);
-	g_free(priv->type_hint);
-	g_free(priv->tooltip);
+purple_request_field_list_finalize(GObject *obj) {
+	PurpleRequestFieldList *field = PURPLE_REQUEST_FIELD_LIST(obj);
 
-	if(priv->type == PURPLE_REQUEST_FIELD_LIST) {
-		g_list_free_full(priv->u.list.items,
-		                 (GDestroyNotify)purple_key_value_pair_free);
-		g_list_free_full(priv->u.list.selected, g_free);
-		g_hash_table_destroy(priv->u.list.item_data);
-		g_hash_table_destroy(priv->u.list.selected_table);
-	} else if(priv->type == PURPLE_REQUEST_FIELD_DATASHEET) {
-		purple_request_datasheet_free(priv->u.datasheet.sheet);
-	} else if(priv->type == PURPLE_REQUEST_FIELD_IMAGE) {
-		g_free(priv->u.image.buffer);
-	}
+	g_list_free_full(field->items, (GDestroyNotify)purple_key_value_pair_free);
+	g_list_free_full(field->selected, g_free);
+	g_hash_table_destroy(field->item_data);
+	g_hash_table_destroy(field->selected_table);
 
-	G_OBJECT_CLASS(purple_request_field_parent_class)->finalize(obj);
+	G_OBJECT_CLASS(purple_request_field_list_parent_class)->finalize(obj);
 }
 
 static void
-purple_request_field_init(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
+purple_request_field_list_init(PurpleRequestFieldList *field) {
+	field->item_data = g_hash_table_new_full(g_str_hash, g_str_equal,
+	                                         g_free, NULL);
 
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->visible = TRUE;
-	priv->sensitive = TRUE;
+	field->selected_table = g_hash_table_new_full(g_str_hash, g_str_equal,
+	                                              g_free, NULL);
 }
 
 static void
-purple_request_field_class_init(PurpleRequestFieldClass *klass) {
+purple_request_field_list_class_init(PurpleRequestFieldListClass *klass) {
 	GObjectClass *obj_class = G_OBJECT_CLASS(klass);
 
-	obj_class->finalize = purple_request_field_finalize;
-	obj_class->get_property = purple_request_field_get_property;
-	obj_class->set_property = purple_request_field_set_property;
+	obj_class->finalize = purple_request_field_list_finalize;
+	obj_class->get_property = purple_request_field_list_get_property;
+	obj_class->set_property = purple_request_field_list_set_property;
 
 	/**
-	 * PurpleRequestField:id:
-	 *
-	 * The ID of the field.
+	 * PurpleRequestFieldChoice:multi-select:
 	 *
-	 * Since: 3.0.0
-	 */
-	properties[PROP_ID] = g_param_spec_string(
-		"id", "id",
-		"The ID of the field.",
-		NULL,
-		G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * PurpleRequestField:label:
-	 *
-	 * The label of the field.
+	 * Whether the field should allow multiple selections.
 	 *
 	 * Since: 3.0.0
 	 */
-	properties[PROP_LABEL] = g_param_spec_string(
-		"label", "label",
-		"The label of the field.",
-		NULL,
-		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * PurpleRequestField:visible:
-	 *
-	 * Whether the field should be visible.
-	 *
-	 * Since: 3.0.0
-	 */
-	properties[PROP_VISIBLE] = g_param_spec_boolean(
-		"visible", "visible",
-		"Whether the field should be visible.",
-		TRUE,
-		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * PurpleRequestField:sensitive:
-	 *
-	 * Whether the field should be sensitive.
-	 *
-	 * Since: 3.0.0
-	 */
-	properties[PROP_SENSITIVE] = g_param_spec_boolean(
-		"sensitive", "sensitive",
-		"Whether the field should be sensitive.",
-		TRUE,
-		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * PurpleRequestField:type-hint:
-	 *
-	 * The type hint of the field.
-	 *
-	 * Since: 3.0.0
-	 */
-	properties[PROP_TYPE_HINT] = g_param_spec_string(
-		"type-hint", "type-hint",
-		"The type hint of the field.",
-		NULL,
-		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * PurpleRequestField:tooltip:
-	 *
-	 * The tooltip of the field.
-	 *
-	 * Since: 3.0.0
-	 */
-	properties[PROP_TOOLTIP] = g_param_spec_string(
-		"tooltip", "tooltip",
-		"The tooltip of the field.",
-		NULL,
-		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * PurpleRequestField:required:
-	 *
-	 * Whether the field is required to complete the request.
-	 *
-	 * Since: 3.0.0
-	 */
-	properties[PROP_REQUIRED] = g_param_spec_boolean(
-		"required", "required",
-		"Whether the field is required to complete the request.",
+	properties[PROP_MULTI_SELECT] = g_param_spec_boolean(
+		"multi-select", "multi-select",
+		"Whether the field should allow multiple selections.",
 		FALSE,
 		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 
-	/**
-	 * PurpleRequestField:is-validatable:
-	 *
-	 * Whether the field can be validated by the requestor.
-	 *
-	 * Since: 3.0.0
-	 */
-	properties[PROP_IS_VALIDATABLE] = g_param_spec_boolean(
-		"is-validatable", "is-validatable",
-		"Whether the field can be validated by the requestor.",
-		FALSE,
-		G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-
 	g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
 }
 
@@ -350,641 +135,147 @@ purple_request_field_class_init(PurpleRe
  * Public API
  *****************************************************************************/
 PurpleRequestField *
-purple_request_field_new(const char *id, const char *text,
-                         PurpleRequestFieldType type)
-{
-	PurpleRequestField *field;
-
-	g_return_val_if_fail(id != NULL, NULL);
-	g_return_val_if_fail(type != PURPLE_REQUEST_FIELD_NONE, NULL);
-
-	field = g_object_new(PURPLE_TYPE_REQUEST_FIELD,
-	                     "id", id,
-	                     "label", text,
-	                     NULL);
-	purple_request_field_set_field_type(field, type);
-
-	return field;
-}
+purple_request_field_list_new(const char *id, const char *text) {
+	g_return_val_if_fail(id   != NULL, NULL);
 
-void
-_purple_request_field_set_group(PurpleRequestField *field,
-                                PurpleRequestGroup *group)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->group = group;
-}
-
-void
-purple_request_field_set_label(PurpleRequestField *field, const char *label)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-
-	g_free(priv->label);
-	priv->label = g_strdup(label);
-
-	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_LABEL]);
+	return g_object_new(PURPLE_TYPE_REQUEST_FIELD_LIST,
+	                    "id", id,
+	                    "label", text,
+	                    NULL);
 }
 
 void
-purple_request_field_set_visible(PurpleRequestField *field, gboolean visible)
+purple_request_field_list_set_multi_select(PurpleRequestFieldList *field,
+                                           gboolean multi_select)
 {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->visible = visible;
-
-	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_VISIBLE]);
-}
-
-void
-purple_request_field_set_type_hint(PurpleRequestField *field,
-								 const char *type_hint)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-
-	g_free(priv->type_hint);
-	priv->type_hint = g_strdup(type_hint);
+	g_return_if_fail(PURPLE_IS_REQUEST_FIELD_LIST(field));
 
-	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_TYPE_HINT]);
-}
-
-void
-purple_request_field_set_tooltip(PurpleRequestField *field, const char *tooltip)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-
-	g_free(priv->tooltip);
-	priv->tooltip = g_strdup(tooltip);
-
-	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_TOOLTIP]);
-}
-
-void
-purple_request_field_set_required(PurpleRequestField *field, gboolean required)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-
-	if(priv->required == required) {
+	if(field->multiple_selection == multi_select) {
 		return;
 	}
 
-	priv->required = required;
-
-	if(PURPLE_IS_REQUEST_GROUP(priv->group)) {
-		_purple_request_group_set_field_required(priv->group, field,
-		                                         required);
-	}
-
-	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_REQUIRED]);
-}
-
-PurpleRequestFieldType
-purple_request_field_get_field_type(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field),
-	                     PURPLE_REQUEST_FIELD_NONE);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->type;
-}
-
-PurpleRequestGroup *
-purple_request_field_get_group(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
+	field->multiple_selection = multi_select;
 
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->group;
-}
-
-const char *
-purple_request_field_get_id(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->id;
-}
-
-const char *
-purple_request_field_get_label(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->label;
+	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_MULTI_SELECT]);
 }
 
 gboolean
-purple_request_field_is_visible(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->visible;
-}
+purple_request_field_list_get_multi_select(PurpleRequestFieldList *field) {
+	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD_LIST(field), FALSE);
 
-const char *
-purple_request_field_get_type_hint(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->type_hint;
+	return field->multiple_selection;
 }
 
-const char *
-purple_request_field_get_tooltip(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->tooltip;
-}
-
-gboolean
-purple_request_field_is_required(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
+gpointer
+purple_request_field_list_get_data(PurpleRequestFieldList *field,
+                                   const char *text)
+{
+	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD_LIST(field), NULL);
+	g_return_val_if_fail(text  != NULL, NULL);
 
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->required;
-}
-
-gboolean
-purple_request_field_is_filled(PurpleRequestField *field) {
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	if(PURPLE_IS_REQUEST_FIELD_STRING(field)) {
-		PurpleRequestFieldString *sfield = PURPLE_REQUEST_FIELD_STRING(field);
-		return !purple_strempty(purple_request_field_string_get_value(sfield));
-	}
-
-	return TRUE;
+	return g_hash_table_lookup(field->item_data, text);
 }
 
 void
-purple_request_field_set_validator(PurpleRequestField *field,
-	PurpleRequestFieldValidator validator, void *user_data)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->validator = validator;
-	priv->validator_data = validator ? user_data : NULL;
-
-	if(PURPLE_IS_REQUEST_GROUP(priv->group)) {
-		_purple_request_group_set_field_validator(priv->group, field,
-		                                          validator != NULL);
-	}
-
-	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_IS_VALIDATABLE]);
-}
-
-gboolean
-purple_request_field_is_validatable(PurpleRequestField *field)
+purple_request_field_list_add_icon(PurpleRequestFieldList *field,
+                                   const char *item, const char *icon_path,
+                                   gpointer data)
 {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->validator != NULL;
-}
-
-gboolean
-purple_request_field_is_valid(PurpleRequestField *field, gchar **errmsg)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-	gboolean valid;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	if(!priv->validator) {
-		return TRUE;
-	}
-
-	if (!purple_request_field_is_required(field) &&
-		!purple_request_field_is_filled(field))
-		return TRUE;
-
-	valid = priv->validator(field, errmsg, priv->validator_data);
+	PurpleKeyValuePair *kvp;
 
-	if (valid && errmsg)
-		*errmsg = NULL;
-
-	return valid;
-}
-
-void
-purple_request_field_set_sensitive(PurpleRequestField *field,
-	gboolean sensitive)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->sensitive = sensitive;
-
-	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_SENSITIVE]);
-}
-
-gboolean
-purple_request_field_is_sensitive(PurpleRequestField *field)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
+	g_return_if_fail(PURPLE_IS_REQUEST_FIELD_LIST(field));
+	g_return_if_fail(item  != NULL);
+	g_return_if_fail(data  != NULL);
 
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->sensitive;
-}
-
-PurpleRequestField *
-purple_request_field_list_new(const char *id, const char *text)
-{
-	PurpleRequestField *field;
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(id   != NULL, NULL);
-
-	field = purple_request_field_new(id, text, PURPLE_REQUEST_FIELD_LIST);
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->u.list.item_data = g_hash_table_new_full(g_str_hash, g_str_equal,
-	                                               g_free, NULL);
-
-	priv->u.list.selected_table = g_hash_table_new_full(g_str_hash, g_str_equal,
-	                                                    g_free, NULL);
-
-	return field;
+	field->has_icons = field->has_icons || (icon_path != NULL);
+	kvp = purple_key_value_pair_new_full(item, g_strdup(icon_path), g_free);
+	field->items = g_list_append(field->items, kvp);
+	g_hash_table_insert(field->item_data, g_strdup(item), data);
 }
 
 void
-purple_request_field_list_set_multi_select(PurpleRequestField *field,
-										 gboolean multi_select)
+purple_request_field_list_add_selected(PurpleRequestFieldList *field,
+                                       const char *item)
 {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST);
-
-	priv->u.list.multiple_selection = multi_select;
-}
-
-gboolean
-purple_request_field_list_get_multi_select(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
+	g_return_if_fail(PURPLE_IS_REQUEST_FIELD_LIST(field));
+	g_return_if_fail(item  != NULL);
 
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, FALSE);
-
-	return priv->u.list.multiple_selection;
-}
+	if(!field->multiple_selection && field->selected != NULL) {
+		purple_debug_warning("request",
+						   "More than one item added to non-multi-select "
+						   "field %s\n",
+						   purple_request_field_get_id(PURPLE_REQUEST_FIELD(field)));
+		return;
+	}
 
-void *
-purple_request_field_list_get_data(PurpleRequestField *field, const char *text)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
+	field->selected = g_list_append(field->selected, g_strdup(item));
 
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-	g_return_val_if_fail(text  != NULL, NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, NULL);
-
-	return g_hash_table_lookup(priv->u.list.item_data, text);
+	g_hash_table_add(field->selected_table, g_strdup(item));
 }
 
 void
-purple_request_field_list_add_icon(PurpleRequestField *field, const char *item, const char* icon_path,
-							void *data)
-{
-	PurpleKeyValuePair *kvp;
-	PurpleRequestFieldPrivate *priv = NULL;
+purple_request_field_list_clear_selected(PurpleRequestFieldList *field) {
+	g_return_if_fail(PURPLE_IS_REQUEST_FIELD_LIST(field));
 
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-	g_return_if_fail(item  != NULL);
-	g_return_if_fail(data  != NULL);
+	g_list_free_full(field->selected, g_free);
+	field->selected = NULL;
 
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST);
-
-	priv->u.list.has_icons = priv->u.list.has_icons || (icon_path != NULL);
-	kvp = purple_key_value_pair_new_full(item, g_strdup(icon_path), g_free);
-	priv->u.list.items = g_list_append(priv->u.list.items, kvp);
-	g_hash_table_insert(priv->u.list.item_data, g_strdup(item), data);
+	g_hash_table_remove_all(field->selected_table);
 }
 
 void
-purple_request_field_list_add_selected(PurpleRequestField *field, const char *item)
+purple_request_field_list_set_selected(PurpleRequestFieldList *field,
+                                       GList *items)
 {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-	g_return_if_fail(item  != NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST);
-
-	if(!purple_request_field_list_get_multi_select(field) &&
-	   priv->u.list.selected != NULL)
-	{
-		purple_debug_warning("request",
-						   "More than one item added to non-multi-select "
-						   "field %s\n",
-						   purple_request_field_get_id(field));
-		return;
-	}
-
-	priv->u.list.selected = g_list_append(priv->u.list.selected,
-	                                      g_strdup(item));
-
-	g_hash_table_add(priv->u.list.selected_table, g_strdup(item));
-}
-
-void
-purple_request_field_list_clear_selected(PurpleRequestField *field)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST);
-
-	if(priv->u.list.selected != NULL) {
-		g_list_free_full(priv->u.list.selected, g_free);
-		priv->u.list.selected = NULL;
-	}
-
-	g_hash_table_remove_all(priv->u.list.selected_table);
-}
-
-void
-purple_request_field_list_set_selected(PurpleRequestField *field, GList *items)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
 	GList *l;
 
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
+	g_return_if_fail(PURPLE_IS_REQUEST_FIELD_LIST(field));
 	g_return_if_fail(items != NULL);
 
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST);
-
 	purple_request_field_list_clear_selected(field);
 
 	if (!purple_request_field_list_get_multi_select(field) && items->next) {
 		purple_debug_warning("request",
 						   "More than one item added to non-multi-select "
 						   "field %s\n",
-						   purple_request_field_get_id(field));
+						   purple_request_field_get_id(PURPLE_REQUEST_FIELD(field)));
 		return;
 	}
 
 	for (l = items; l != NULL; l = l->next) {
 		char *selected = l->data;
-		priv->u.list.selected = g_list_append(priv->u.list.selected,
-		                                      g_strdup(selected));
-		g_hash_table_add(priv->u.list.selected_table, g_strdup(selected));
+		field->selected = g_list_append(field->selected, g_strdup(selected));
+		g_hash_table_add(field->selected_table, g_strdup(selected));
 	}
 }
 
 gboolean
-purple_request_field_list_is_selected(PurpleRequestField *field,
+purple_request_field_list_is_selected(PurpleRequestFieldList *field,
                                       const char *item)
 {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
+	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD_LIST(field), FALSE);
 	g_return_val_if_fail(item  != NULL, FALSE);
 
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, FALSE);
-
-	return g_hash_table_contains(priv->u.list.selected_table, item);
+	return g_hash_table_contains(field->selected_table, item);
 }
 
 GList *
-purple_request_field_list_get_selected(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
+purple_request_field_list_get_selected(PurpleRequestFieldList *field) {
+	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD_LIST(field), NULL);
 
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, NULL);
-
-	return priv->u.list.selected;
+	return field->selected;
 }
 
 GList *
-purple_request_field_list_get_items(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
+purple_request_field_list_get_items(PurpleRequestFieldList *field) {
+	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD_LIST(field), NULL);
 
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, NULL);
-
-	return priv->u.list.items;
+	return field->items;
 }
 
 gboolean
-purple_request_field_list_has_icons(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, FALSE);
-
-	return priv->u.list.has_icons;
-}
-
-PurpleRequestField *
-purple_request_field_label_new(const char *id, const char *text)
-{
-	PurpleRequestField *field;
-
-	g_return_val_if_fail(id   != NULL, NULL);
-	g_return_val_if_fail(text != NULL, NULL);
-
-	field = purple_request_field_new(id, text, PURPLE_REQUEST_FIELD_LABEL);
-
-	return field;
-}
-
-PurpleRequestField *
-purple_request_field_image_new(const char *id, const char *text, const char *buf, gsize size)
-{
-	PurpleRequestField *field;
-
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(id   != NULL, NULL);
-	g_return_val_if_fail(text != NULL, NULL);
-	g_return_val_if_fail(buf  != NULL, NULL);
-	g_return_val_if_fail(size > 0, NULL);
-
-	field = purple_request_field_new(id, text, PURPLE_REQUEST_FIELD_IMAGE);
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->u.image.buffer = g_memdup2(buf, size);
-	priv->u.image.size = size;
-	priv->u.image.scale_x = 1;
-	priv->u.image.scale_y = 1;
-
-	return field;
-}
-
-void
-purple_request_field_image_set_scale(PurpleRequestField *field, unsigned int x, unsigned int y)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_IMAGE);
-
-	priv->u.image.scale_x = x;
-	priv->u.image.scale_y = y;
-}
-
-const char *
-purple_request_field_image_get_buffer(PurpleRequestField *field)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_IMAGE, NULL);
+purple_request_field_list_has_icons(PurpleRequestFieldList *field) {
+	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD_LIST(field), FALSE);
 
-	return priv->u.image.buffer;
-}
-
-gsize
-purple_request_field_image_get_size(PurpleRequestField *field)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), 0);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_IMAGE, 0);
-
-	return priv->u.image.size;
-}
-
-unsigned int
-purple_request_field_image_get_scale_x(PurpleRequestField *field)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), 0);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_IMAGE, 0);
-
-	return priv->u.image.scale_x;
+	return field->has_icons;
 }
-
-unsigned int
-purple_request_field_image_get_scale_y(PurpleRequestField *field)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), 0);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_IMAGE, 0);
-
-	return priv->u.image.scale_y;
-}
-
-PurpleRequestField *
-purple_request_field_datasheet_new(const char *id,
-	const gchar *text, PurpleRequestDatasheet *sheet)
-{
-	PurpleRequestField *field;
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(id != NULL, NULL);
-	g_return_val_if_fail(sheet != NULL, NULL);
-
-	field = purple_request_field_new(id, text, PURPLE_REQUEST_FIELD_DATASHEET);
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->u.datasheet.sheet = sheet;
-
-	return field;
-}
-
-PurpleRequestDatasheet *
-purple_request_field_datasheet_get_sheet(PurpleRequestField *field)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_DATASHEET, NULL);
-
-	return priv->u.datasheet.sheet;
-}
diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c
--- a/pidgin/gtkrequest.c
+++ b/pidgin/gtkrequest.c
@@ -1383,7 +1383,7 @@ static void
 setup_list_field_listitem_cb(G_GNUC_UNUSED GtkSignalListItemFactory *self,
                              GtkListItem *item, gpointer data)
 {
-	PurpleRequestField *field = data;
+	PurpleRequestFieldList *field = data;
 	GtkWidget *box = NULL;
 	GtkWidget *widget = NULL;
 
@@ -1403,7 +1403,7 @@ static void
 bind_list_field_listitem_cb(G_GNUC_UNUSED GtkSignalListItemFactory *self,
                             GtkListItem *item, gpointer data)
 {
-	PurpleRequestField *field = data;
+	PurpleRequestFieldList *field = data;
 	GtkWidget *box = NULL;
 	GtkWidget *label = NULL;
 	GObject *wrapper = NULL;
@@ -1428,7 +1428,7 @@ list_field_select_changed_cb(GtkSelectio
                              G_GNUC_UNUSED guint position,
                              G_GNUC_UNUSED guint n_items, gpointer data)
 {
-	PurpleRequestField *field = data;
+	PurpleRequestFieldList *field = data;
 	GtkBitset *bitset = NULL;
 
 	purple_request_field_list_clear_selected(field);
@@ -1453,8 +1453,8 @@ list_field_select_changed_cb(GtkSelectio
 }
 
 static GtkWidget *
-create_list_field(PurpleRequestField *field)
-{
+create_list_field(PurpleRequestField *field) {
+	PurpleRequestFieldList *listfield = PURPLE_REQUEST_FIELD_LIST(field);
 	GtkWidget *sw;
 	GtkWidget *listview = NULL;
 	GtkSelectionModel *sel = NULL;
@@ -1464,11 +1464,11 @@ create_list_field(PurpleRequestField *fi
 	GList *l;
 	gboolean has_icons;
 
-	has_icons = purple_request_field_list_has_icons(field);
+	has_icons = purple_request_field_list_has_icons(listfield);
 
 	/* Create the list store */
 	store = g_list_store_new(G_TYPE_OBJECT);
-	if(purple_request_field_list_get_multi_select(field)) {
+	if(purple_request_field_list_get_multi_select(listfield)) {
 		sel = GTK_SELECTION_MODEL(gtk_multi_selection_new(G_LIST_MODEL(store)));
 	} else {
 		sel = GTK_SELECTION_MODEL(gtk_single_selection_new(G_LIST_MODEL(store)));
@@ -1488,7 +1488,7 @@ create_list_field(PurpleRequestField *fi
 		gtk_widget_set_size_request(listview, 200, 400);
 	}
 
-	for(index = 0, l = purple_request_field_list_get_items(field);
+	for(index = 0, l = purple_request_field_list_get_items(listfield);
 	    l != NULL;
 	    index++, l = l->next)
 	{
@@ -1500,7 +1500,7 @@ create_list_field(PurpleRequestField *fi
 		g_list_store_append(store, wrapper);
 
 		g_object_set_data(wrapper, "data",
-		                  purple_request_field_list_get_data(field, text));
+		                  purple_request_field_list_get_data(listfield, text));
 		g_object_set_data_full(wrapper, "text", g_strdup(text), g_free);
 
 		if(has_icons) {
@@ -1514,7 +1514,7 @@ create_list_field(PurpleRequestField *fi
 			g_object_set_data_full(wrapper, "pixbuf", pixbuf, g_object_unref);
 		}
 
-		if(purple_request_field_list_is_selected(field, text)) {
+		if(purple_request_field_list_is_selected(listfield, text)) {
 			gtk_selection_model_select_item(sel, index, FALSE);
 		}
 
@@ -2054,7 +2054,7 @@ pidgin_request_fields(const char *title,
 			{
 				rows++;
 			}
-			else if ((type == PURPLE_REQUEST_FIELD_LIST) ||
+			else if(PURPLE_IS_REQUEST_FIELD_LIST(field) ||
 				 (PURPLE_IS_REQUEST_FIELD_STRING(field) &&
 				  purple_request_field_string_is_multiline(PURPLE_REQUEST_FIELD_STRING(field))))
 			{
@@ -2124,7 +2124,7 @@ pidgin_request_fields(const char *title,
 					gtk_size_group_add_widget(sg, label);
 
 					if (type == PURPLE_REQUEST_FIELD_LABEL ||
-					    type == PURPLE_REQUEST_FIELD_LIST ||
+					    PURPLE_IS_REQUEST_FIELD_LIST(field) ||
 						(PURPLE_IS_REQUEST_FIELD_STRING(field) &&
 						 purple_request_field_string_is_multiline(PURPLE_REQUEST_FIELD_STRING(field))))
 					{
@@ -2154,9 +2154,9 @@ pidgin_request_fields(const char *title,
 						widget = create_bool_field(field, cpar);
 					} else if(PURPLE_IS_REQUEST_FIELD_CHOICE(field)) {
 						widget = create_choice_field(field);
-					} else if (type == PURPLE_REQUEST_FIELD_LIST)
+					} else if(PURPLE_IS_REQUEST_FIELD_LIST(field)) {
 						widget = create_list_field(field);
-					else if (type == PURPLE_REQUEST_FIELD_IMAGE)
+					} else if (type == PURPLE_REQUEST_FIELD_IMAGE)
 						widget = create_image_field(field);
 					else if(PURPLE_IS_REQUEST_FIELD_ACCOUNT(field)) {
 						widget = create_account_field(field);
@@ -2182,9 +2182,7 @@ pidgin_request_fields(const char *title,
 				{
 					gtk_grid_attach(GTK_GRID(grid), widget,
 						0, row_num, 2 * cols, 1);
-				}
-				else if (type == PURPLE_REQUEST_FIELD_LIST)
-				{
+				} else if(PURPLE_IS_REQUEST_FIELD_LIST(field)) {
 					gtk_grid_attach(GTK_GRID(grid), widget,
 						0, row_num, 2 * cols, 1);
 				} else if(PURPLE_IS_REQUEST_FIELD_BOOL(field)) {
diff --git a/pidgin/pidginmooddialog.c b/pidgin/pidginmooddialog.c
--- a/pidgin/pidginmooddialog.c
+++ b/pidgin/pidginmooddialog.c
@@ -65,11 +65,12 @@ static void
 pidgin_mood_dialog_edit_cb(PurpleConnection *connection,
                            PurpleRequestPage *page)
 {
-	PurpleRequestField *mood_field = NULL;
+	PurpleRequestFieldList *mood_field = NULL;
 	GList *l = NULL;
 	const gchar *mood = NULL;
 
-	mood_field = purple_request_page_get_field(page, "mood");
+	mood_field = PURPLE_REQUEST_FIELD_LIST(purple_request_page_get_field(page,
+	                                                                     "mood"));
 	l = purple_request_field_list_get_selected(mood_field);
 
 	if(l == NULL) {
@@ -243,8 +244,9 @@ void
 pidgin_mood_dialog_show(PurpleAccount *account) {
 	const gchar *current_mood;
 	PurpleRequestPage *page;
-	PurpleRequestGroup *g;
-	PurpleRequestField *f;
+	PurpleRequestGroup *group = NULL;
+	PurpleRequestField *field = NULL;
+	PurpleRequestFieldList *fieldlist = NULL;
 	PurpleConnection *gc = NULL;
 	PurpleProtocol *protocol = NULL;
 	PurpleMood *mood = NULL;
@@ -262,12 +264,15 @@ pidgin_mood_dialog_show(PurpleAccount *a
 	}
 
 	page = purple_request_page_new();
-	g = purple_request_group_new(NULL);
-	f = purple_request_field_list_new("mood", _("Please select your mood from the list"));
+	group = purple_request_group_new(NULL);
+	field = purple_request_field_list_new("mood",
+	                                      _("Please select your mood from the list"));
+	fieldlist = PURPLE_REQUEST_FIELD_LIST(field);
 
-	purple_request_field_list_add_icon(f, _("None"), NULL, "");
-	if (current_mood == NULL)
-		purple_request_field_list_add_selected(f, _("None"));
+	purple_request_field_list_add_icon(fieldlist, _("None"), NULL, "");
+	if(current_mood == NULL) {
+		purple_request_field_list_add_selected(fieldlist, _("None"));
+	}
 
 	/* TODO: rlaager wants this sorted. */
 	/* TODO: darkrain wants it sorted post-translation */
@@ -287,24 +292,24 @@ pidgin_mood_dialog_show(PurpleAccount *a
 		}
 
 		path = pidgin_mood_get_icon_path(mood->mood);
-		purple_request_field_list_add_icon(f, _(mood->description),
-				path, (gpointer)mood->mood);
+		purple_request_field_list_add_icon(fieldlist, _(mood->description),
+		                                   path, (gpointer)mood->mood);
 		g_free(path);
 
 		if (current_mood && purple_strequal(current_mood, mood->mood))
-			purple_request_field_list_add_selected(f, _(mood->description));
+			purple_request_field_list_add_selected(fieldlist, _(mood->description));
 	}
-	purple_request_group_add_field(g, f);
+	purple_request_group_add_field(group, field);
 
-	purple_request_page_add_group(page, g);
+	purple_request_page_add_group(page, group);
 
 	/* if the connection allows setting a mood message */
 	if (gc && (purple_connection_get_flags(gc) & PURPLE_CONNECTION_FLAG_SUPPORT_MOOD_MESSAGES)) {
-		g = purple_request_group_new(NULL);
-		f = purple_request_field_string_new("text",
-		    _("Message (optional)"), NULL, FALSE);
-		purple_request_group_add_field(g, f);
-		purple_request_page_add_group(page, g);
+		group = purple_request_group_new(NULL);
+		field = purple_request_field_string_new("text", _("Message (optional)"),
+		                                        NULL, FALSE);
+		purple_request_group_add_field(group, field);
+		purple_request_page_add_group(page, group);
 	}
 
 	purple_request_fields(gc, _("Edit User Mood"), _("Edit User Mood"),
