# HG changeset patch
# Node ID 4179c173ae15
# Parent  f7236e23d4d9
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -49,16 +49,10 @@ version 3.0.0 (??/??/????):
 		* purple_protocol_factory_iface_* for factory interface methods
 		* purple_protocol_action_new
 		* purple_protocol_action_free
-		* purple_request_certificate
-		* purple_request_field_certificate_new
-		* purple_request_field_certificate_get_value
 		* purple_request_field_choice_add_full
 		* purple_request_field_get_tooltip
-		* purple_request_field_group_get_fields_list
 		* purple_request_field_list_has_icons
 		* purple_request_field_set_tooltip
-		* purple_request_fields_get_ui_data
-		* purple_request_fields_set_ui_data
 		* purple_roomlist_get_account
 		* purple_roomlist_get_proto_data
 		* purple_roomlist_room_get_expanded_once
@@ -242,11 +236,7 @@ version 3.0.0 (??/??/????):
 		  PurpleRequestPage. Please see the documentation for details.
 		* purple_request_field_get_field_type_hint renamed to
 		  purple_request_field_get_type_hint
-		* purple_request_field_group_get_tab
-		* purple_request_field_group_set_tab
 		* purple_request_field_list_get_items now returns list of PurpleKeyValuePair
-		* purple_request_fields_get_tab_names
-		* purple_request_fields_set_tab_names
 		* purple_roomlist_room_get_type is now
 		  purple_roomlist_room_get_room_type
 		* purple_roomlist_field_get_type is now
@@ -710,7 +700,6 @@ version 3.0.0 (??/??/????):
 		* purple_prpl_send_attention
 		* purple_quotedp_decode. See the GMime library if needed.
 		* purple_restore_default_signal_handlers
-		* purple_request_certificate
 		* purple_request_field_choice_set_data_destructor. Use
 		  purple_request_field_choice_add_full instead
 		* purple_request_field_destroy. Use g_object_unref instead.
diff --git a/libpurple/meson.build b/libpurple/meson.build
--- a/libpurple/meson.build
+++ b/libpurple/meson.build
@@ -379,7 +379,7 @@ pkgconfig.generate(
 
 if enable_introspection
 	introspection_sources = (purple_coresources + purple_coreheaders +
-	                         purple_builtheaders + purple_mediaheaders)
+	                         purple_builtheaders + purple_mediaheaders + purple_request_headers)
 
 	libpurple_gir = gnome.generate_gir(libpurple,
 	    sources : introspection_sources,
diff --git a/libpurple/purplerequestfield.h b/libpurple/purplerequestfield.h
--- a/libpurple/purplerequestfield.h
+++ b/libpurple/purplerequestfield.h
@@ -27,8 +27,6 @@
 #ifndef PURPLE_REQUEST_FIELD_H
 #define PURPLE_REQUEST_FIELD_H
 
-#include <stdlib.h>
-
 #include <glib.h>
 #include <glib-object.h>
 
@@ -36,13 +34,12 @@
  * PurpleRequestField:
  *
  * A request field.
+ *
+ * Since: 3.0.0
  */
 typedef struct _PurpleRequestField PurpleRequestField;
 
-#include "request.h"
-#include "request-datasheet.h"
-
-#define PURPLE_DEFAULT_ACTION_NONE	-1
+#include "purplerequestgroup.h"
 
 /**
  * PurpleRequestFieldClass:
@@ -61,45 +58,16 @@ struct _PurpleRequestFieldClass {
 	gpointer reserved[4];
 };
 
-/**
- * PurpleRequestFieldType:
- * @PURPLE_REQUEST_FIELD_NONE: No field.
- *
- * A type of field.
- */
-typedef enum
-{
-	PURPLE_REQUEST_FIELD_NONE,
-
-} PurpleRequestFieldType;
-
 typedef gboolean (*PurpleRequestFieldValidator)(PurpleRequestField *field,
 	gchar **errmsg, gpointer user_data);
 
 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.
@@ -140,8 +108,7 @@ void purple_request_field_set_type_hint(
  * 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);
+void purple_request_field_set_tooltip(PurpleRequestField *field, const char *tooltip);
 
 /**
  * purple_request_field_set_required:
@@ -150,18 +117,7 @@ void purple_request_field_set_tooltip(Pu
  *
  * 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);
+void purple_request_field_set_required(PurpleRequestField *field, gboolean required);
 
 /**
  * purple_request_field_get_group:
@@ -289,8 +245,7 @@ gboolean purple_request_field_is_valid(P
  *
  * Sets field editable.
  */
-void purple_request_field_set_sensitive(PurpleRequestField *field,
-	gboolean sensitive);
+void purple_request_field_set_sensitive(PurpleRequestField *field, gboolean sensitive);
 
 /**
  * purple_request_field_is_sensitive:
@@ -302,41 +257,6 @@ void purple_request_field_set_sensitive(
  */
 gboolean purple_request_field_is_sensitive(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);
-
 G_END_DECLS
 
 #endif /* PURPLE_REQUEST_FIELD_H */
diff --git a/libpurple/purplerequestfield.c b/libpurple/purplerequestfield.c
--- a/libpurple/purplerequestfield.c
+++ b/libpurple/purplerequestfield.c
@@ -15,21 +15,16 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <glib/gi18n-lib.h>
 
-#include "glibcompat.h"
 #include "request.h"
 #include "request/purplerequestfieldstring.h"
-#include "debug.h"
-#include "purplekeyvaluepair.h"
 #include "purpleprivate.h"
 
 typedef struct {
-	PurpleRequestFieldType type;
 	PurpleRequestGroup *group;
 
 	char *id;
@@ -40,7 +35,6 @@ typedef struct {
 	gboolean required;
 	gboolean sensitive;
 
-	void *ui_data;
 	char *tooltip;
 
 	PurpleRequestFieldValidator validator;
@@ -61,7 +55,8 @@ enum {
 };
 static GParamSpec *properties[N_PROPERTIES] = {NULL, };
 
-G_DEFINE_TYPE_WITH_PRIVATE(PurpleRequestField, purple_request_field, G_TYPE_OBJECT)
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(PurpleRequestField, purple_request_field,
+                                    G_TYPE_OBJECT)
 
 /******************************************************************************
  * Helpers
@@ -78,17 +73,6 @@ purple_request_field_set_id(PurpleReques
 	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
  *****************************************************************************/
@@ -314,24 +298,6 @@ 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;
-}
-
 void
 _purple_request_field_set_group(PurpleRequestField *field,
                                 PurpleRequestGroup *group)
@@ -428,18 +394,6 @@ purple_request_field_set_required(Purple
 	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;
diff --git a/libpurple/purplerequestgroup.h b/libpurple/purplerequestgroup.h
--- a/libpurple/purplerequestgroup.h
+++ b/libpurple/purplerequestgroup.h
@@ -27,8 +27,6 @@
 #ifndef PURPLE_REQUEST_GROUP_H
 #define PURPLE_REQUEST_GROUP_H
 
-#include <stdlib.h>
-
 #include <glib.h>
 #include <glib-object.h>
 
@@ -36,10 +34,13 @@
  * PurpleRequestGroup:
  *
  * A group of fields with a title.
+ *
+ * Since: 3.0.0
  */
 typedef struct _PurpleRequestGroup PurpleRequestGroup;
 
 #include "purplerequestfield.h"
+#include "purplerequestpage.h"
 
 #define PURPLE_TYPE_REQUEST_GROUP (purple_request_group_get_type())
 G_DECLARE_FINAL_TYPE(PurpleRequestGroup, purple_request_group,
@@ -54,6 +55,8 @@ G_BEGIN_DECLS
  * Creates a fields group with an optional title.
  *
  * Returns: (transfer full): A new fields group
+ *
+ * Since: 3.0.0
  */
 PurpleRequestGroup *purple_request_group_new(const char *title);
 
@@ -63,6 +66,8 @@ PurpleRequestGroup *purple_request_group
  * @field: (transfer full): The field to add to the group.
  *
  * Adds a field to the group.
+ *
+ * Since: 3.0.0
  */
 void purple_request_group_add_field(PurpleRequestGroup *group, PurpleRequestField *field);
 
@@ -73,6 +78,8 @@ void purple_request_group_add_field(Purp
  * Returns the title of a fields group.
  *
  * Returns: (nullable): The title, if set.
+ *
+ * Since: 3.0.0
  */
 const char *purple_request_group_get_title(PurpleRequestGroup *group);
 
@@ -83,6 +90,8 @@ const char *purple_request_group_get_tit
  * Returns a list of all fields in a group.
  *
  * Returns: (element-type PurpleRequestField) (transfer none): The list of fields in the group.
+ *
+ * Since: 3.0.0
  */
 GList *purple_request_group_get_fields(PurpleRequestGroup *group);
 
@@ -93,6 +102,8 @@ GList *purple_request_group_get_fields(P
  * Returns a list of all fields in a group.
  *
  * Returns: (transfer none): The list of fields in the group.
+ *
+ * Since: 3.0.0
  */
 PurpleRequestPage *purple_request_group_get_page(PurpleRequestGroup *group);
 
diff --git a/libpurple/purplerequestgroup.c b/libpurple/purplerequestgroup.c
--- a/libpurple/purplerequestgroup.c
+++ b/libpurple/purplerequestgroup.c
@@ -15,14 +15,13 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <glib/gi18n-lib.h>
 
-#include "glibcompat.h"
 #include "purplerequestgroup.h"
+#include "purplerequestpage.h"
 #include "purpleprivate.h"
 
 struct _PurpleRequestGroup {
diff --git a/libpurple/purplerequestpage.h b/libpurple/purplerequestpage.h
--- a/libpurple/purplerequestpage.h
+++ b/libpurple/purplerequestpage.h
@@ -27,8 +27,6 @@
 #ifndef PURPLE_REQUEST_PAGE_H
 #define PURPLE_REQUEST_PAGE_H
 
-#include <stdlib.h>
-
 #include <glib.h>
 #include <glib-object.h>
 
@@ -36,6 +34,8 @@
  * PurpleRequestPage:
  *
  * Multiple fields request data.
+ *
+ * Since: 3.0.0
  */
 typedef struct _PurpleRequestPage PurpleRequestPage;
 
@@ -55,6 +55,8 @@ G_DECLARE_FINAL_TYPE(PurpleRequestPage, 
  * Creates a page of fields to pass to [func@Purple.request_fields].
  *
  * Returns: (transfer full): The new request page.
+ *
+ * Since: 3.0.0
  */
 PurpleRequestPage *purple_request_page_new(void);
 
@@ -64,6 +66,8 @@ PurpleRequestPage *purple_request_page_n
  * @group: (transfer full): The group to add.
  *
  * Adds a group of fields to the list.
+ *
+ * Since: 3.0.0
  */
 void purple_request_page_add_group(PurpleRequestPage *page, PurpleRequestGroup *group);
 
@@ -74,6 +78,8 @@ void purple_request_page_add_group(Purpl
  * Returns a list of all groups in a field list.
  *
  * Returns: (element-type PurpleRequestGroup) (transfer none): A list of groups.
+ *
+ * Since: 3.0.0
  */
 GList *purple_request_page_get_groups(PurpleRequestPage *page);
 
@@ -85,6 +91,8 @@ GList *purple_request_page_get_groups(Pu
  * Returns whether or not the field with the specified ID exists.
  *
  * Returns: TRUE if the field exists, or FALSE.
+ *
+ * Since: 3.0.0
  */
 gboolean purple_request_page_exists(PurpleRequestPage *page, const char *id);
 
@@ -95,6 +103,8 @@ gboolean purple_request_page_exists(Purp
  * Returns a list of all required fields.
  *
  * Returns: (element-type PurpleRequestField) (transfer none): The list of required fields.
+ *
+ * Since: 3.0.0
  */
 const GList *purple_request_page_get_required(PurpleRequestPage *page);
 
@@ -105,6 +115,8 @@ const GList *purple_request_page_get_req
  * Returns a list of all validated fields.
  *
  * Returns: (element-type PurpleRequestField) (transfer none): The list of validated fields.
+ *
+ * Since: 3.0.0
  */
 const GList *purple_request_page_get_validatable(PurpleRequestPage *page);
 
@@ -116,6 +128,8 @@ const GList *purple_request_page_get_val
  * Returns whether or not a field with the specified ID is required.
  *
  * Returns: TRUE if the specified field is required, or FALSE.
+ *
+ * Since: 3.0.0
  */
 gboolean purple_request_page_is_field_required(PurpleRequestPage *page, const char *id);
 
@@ -126,6 +140,8 @@ gboolean purple_request_page_is_field_re
  * Returns whether or not all required fields have values.
  *
  * Returns: TRUE if all required fields have values, or FALSE.
+ *
+ * Since: 3.0.0
  */
 gboolean purple_request_page_all_required_filled(PurpleRequestPage *page);
 
@@ -136,6 +152,8 @@ gboolean purple_request_page_all_require
  * Returns whether or not all fields are valid.
  *
  * Returns: TRUE if all fields are valid, or FALSE.
+ *
+ * Since: 3.0.0
  */
 gboolean purple_request_page_all_valid(PurpleRequestPage *page);
 
@@ -147,6 +165,8 @@ gboolean purple_request_page_all_valid(P
  * Return the field with the specified ID.
  *
  * Returns: (transfer none): The field, if found.
+ *
+ * Since: 3.0.0
  */
 PurpleRequestField *purple_request_page_get_field(PurpleRequestPage *page, const char *id);
 
@@ -158,6 +178,8 @@ PurpleRequestField *purple_request_page_
  * Returns the string value of a field with the specified ID.
  *
  * Returns: The string value, if found, or %NULL otherwise.
+ *
+ * Since: 3.0.0
  */
 const char *purple_request_page_get_string(PurpleRequestPage *page, const char *id);
 
@@ -169,6 +191,8 @@ const char *purple_request_page_get_stri
  * Returns the integer value of a field with the specified ID.
  *
  * Returns: The integer value, if found, or 0 otherwise.
+ *
+ * Since: 3.0.0
  */
 int purple_request_page_get_integer(PurpleRequestPage *page, const char *id);
 
@@ -180,6 +204,8 @@ int purple_request_page_get_integer(Purp
  * Returns the boolean value of a field with the specified ID.
  *
  * Returns: The boolean value, if found, or %FALSE otherwise.
+ *
+ * Since: 3.0.0
  */
 gboolean purple_request_page_get_bool(PurpleRequestPage *page, const char *id);
 
@@ -191,6 +217,8 @@ gboolean purple_request_page_get_bool(Pu
  * Returns the choice index of a field with the specified ID.
  *
  * Returns: The choice value, if found, or NULL otherwise.
+ *
+ * Since: 3.0.0
  */
 gpointer purple_request_page_get_choice(PurpleRequestPage *page, const char *id);
 
@@ -202,6 +230,8 @@ gpointer purple_request_page_get_choice(
  * Returns the account of a field with the specified ID.
  *
  * Returns: (transfer none): The account value, if found, or %NULL otherwise.
+ *
+ * Since: 3.0.0
  */
 PurpleAccount *purple_request_page_get_account(PurpleRequestPage *page, const char *id);
 
diff --git a/libpurple/purplerequestpage.c b/libpurple/purplerequestpage.c
--- a/libpurple/purplerequestpage.c
+++ b/libpurple/purplerequestpage.c
@@ -15,13 +15,11 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <glib/gi18n-lib.h>
 
-#include "glibcompat.h"
 #include "purplerequestpage.h"
 #include "request/purplerequestfieldaccount.h"
 #include "request/purplerequestfieldbool.h"
@@ -40,8 +38,6 @@ struct _PurpleRequestPage {
 	GList *required_fields;
 
 	GList *validated_fields;
-
-	void *ui_data;
 };
 
 /******************************************************************************
diff --git a/libpurple/request/purplerequestfieldaccount.h b/libpurple/request/purplerequestfieldaccount.h
--- a/libpurple/request/purplerequestfieldaccount.h
+++ b/libpurple/request/purplerequestfieldaccount.h
@@ -27,22 +27,21 @@
 #ifndef PURPLE_REQUEST_FIELD_ACCOUNT_H
 #define PURPLE_REQUEST_FIELD_ACCOUNT_H
 
-#include <stdlib.h>
-
 #include <glib.h>
 #include <glib-object.h>
 
+#include "account.h"
+#include "purplerequestfield.h"
+
+G_BEGIN_DECLS
+
 /**
  * PurpleRequestFieldAccount:
  *
  * An account request field.
+ *
+ * Since: 3.0.0
  */
-typedef struct _PurpleRequestFieldAccount PurpleRequestFieldAccount;
-
-#include "account.h"
-
-G_BEGIN_DECLS
-
 #define PURPLE_TYPE_REQUEST_FIELD_ACCOUNT (purple_request_field_account_get_type())
 G_DECLARE_FINAL_TYPE(PurpleRequestFieldAccount, purple_request_field_account,
                      PURPLE, REQUEST_FIELD_ACCOUNT, PurpleRequestField)
@@ -137,7 +136,7 @@ PurpleAccount *purple_request_field_acco
 gboolean purple_request_field_account_get_show_all(PurpleRequestFieldAccount *field);
 
 /**
- * purple_request_field_account_get_filter:
+ * purple_request_field_account_get_filter: (skip):
  * @field: The account field.
  *
  * Returns the account filter function in an account field.
diff --git a/libpurple/request/purplerequestfieldaccount.c b/libpurple/request/purplerequestfieldaccount.c
--- a/libpurple/request/purplerequestfieldaccount.c
+++ b/libpurple/request/purplerequestfieldaccount.c
@@ -15,13 +15,11 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <glib/gi18n-lib.h>
 
-#include "glibcompat.h"
 #include "purpleaccountmanager.h"
 #include "purplerequestfield.h"
 #include "purplerequestfieldaccount.h"
@@ -45,12 +43,12 @@ enum {
 };
 static GParamSpec *properties[N_PROPERTIES] = {NULL, };
 
+/******************************************************************************
+ * GObject Implementation
+ *****************************************************************************/
 G_DEFINE_TYPE(PurpleRequestFieldAccount, purple_request_field_account,
               PURPLE_TYPE_REQUEST_FIELD)
 
-/******************************************************************************
- * GObject Implementation
- *****************************************************************************/
 static void
 purple_request_field_account_get_property(GObject *obj, guint param_id,
                                           GValue *value, GParamSpec *pspec)
diff --git a/libpurple/request/purplerequestfieldbool.h b/libpurple/request/purplerequestfieldbool.h
--- a/libpurple/request/purplerequestfieldbool.h
+++ b/libpurple/request/purplerequestfieldbool.h
@@ -27,22 +27,20 @@
 #ifndef PURPLE_REQUEST_FIELD_BOOL_H
 #define PURPLE_REQUEST_FIELD_BOOL_H
 
-#include <stdlib.h>
-
 #include <glib.h>
 #include <glib-object.h>
 
+#include "purplerequestfield.h"
+
+G_BEGIN_DECLS
+
 /**
  * PurpleRequestFieldBool:
  *
  * A boolean request field.
+ *
+ * Since: 3.0.0
  */
-typedef struct _PurpleRequestFieldBool PurpleRequestFieldBool;
-
-#include "purplerequestfield.h"
-
-G_BEGIN_DECLS
-
 #define PURPLE_TYPE_REQUEST_FIELD_BOOL (purple_request_field_bool_get_type())
 G_DECLARE_FINAL_TYPE(PurpleRequestFieldBool, purple_request_field_bool,
                      PURPLE, REQUEST_FIELD_BOOL, PurpleRequestField)
diff --git a/libpurple/request/purplerequestfieldbool.c b/libpurple/request/purplerequestfieldbool.c
--- a/libpurple/request/purplerequestfieldbool.c
+++ b/libpurple/request/purplerequestfieldbool.c
@@ -15,15 +15,13 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <glib/gi18n-lib.h>
 
-#include "glibcompat.h"
 #include "purplerequestfield.h"
-#include "request/purplerequestfieldbool.h"
+#include "purplerequestfieldbool.h"
 
 struct _PurpleRequestFieldBool {
 	PurpleRequestField parent;
diff --git a/libpurple/request/purplerequestfieldchoice.h b/libpurple/request/purplerequestfieldchoice.h
--- a/libpurple/request/purplerequestfieldchoice.h
+++ b/libpurple/request/purplerequestfieldchoice.h
@@ -27,22 +27,20 @@
 #ifndef PURPLE_REQUEST_FIELD_CHOICE_H
 #define PURPLE_REQUEST_FIELD_CHOICE_H
 
-#include <stdlib.h>
-
 #include <glib.h>
 #include <glib-object.h>
 
+#include "purplerequestfield.h"
+
+G_BEGIN_DECLS
+
 /**
  * PurpleRequestFieldChoice:
  *
  * A choice request field.
+ *
+ * Since: 3.0.0
  */
-typedef struct _PurpleRequestFieldChoice PurpleRequestFieldChoice;
-
-#include "purplerequestfield.h"
-
-G_BEGIN_DECLS
-
 #define PURPLE_TYPE_REQUEST_FIELD_CHOICE (purple_request_field_choice_get_type())
 G_DECLARE_FINAL_TYPE(PurpleRequestFieldChoice, purple_request_field_choice,
                      PURPLE, REQUEST_FIELD_CHOICE, PurpleRequestField)
diff --git a/libpurple/request/purplerequestfieldchoice.c b/libpurple/request/purplerequestfieldchoice.c
--- a/libpurple/request/purplerequestfieldchoice.c
+++ b/libpurple/request/purplerequestfieldchoice.c
@@ -15,15 +15,13 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <glib/gi18n-lib.h>
 
-#include "glibcompat.h"
 #include "purplerequestfield.h"
-#include "request/purplerequestfieldchoice.h"
+#include "purplerequestfieldchoice.h"
 #include "purplekeyvaluepair.h"
 
 struct _PurpleRequestFieldChoice {
diff --git a/libpurple/request/purplerequestfielddatasheet.h b/libpurple/request/purplerequestfielddatasheet.h
--- a/libpurple/request/purplerequestfielddatasheet.h
+++ b/libpurple/request/purplerequestfielddatasheet.h
@@ -27,25 +27,21 @@
 #ifndef PURPLE_REQUEST_FIELD_DATASHEET_H
 #define PURPLE_REQUEST_FIELD_DATASHEET_H
 
-#include <stdlib.h>
-
 #include <glib.h>
 #include <glib-object.h>
 
-/**
- * PurpleRequestField:
- *
- * A request field.
- */
-typedef struct _PurpleRequestField PurpleRequestField;
-
 #include "request.h"
 #include "request-datasheet.h"
 
-#define PURPLE_DEFAULT_ACTION_NONE	-1
-
 G_BEGIN_DECLS
 
+/**
+ * PurpleRequestFieldDatasheet:
+ *
+ * A datasheet request field.
+ *
+ * Since: 3.0.0
+ */
 #define PURPLE_TYPE_REQUEST_FIELD_DATASHEET (purple_request_field_datasheet_get_type())
 G_DECLARE_FINAL_TYPE(PurpleRequestFieldDatasheet, purple_request_field_datasheet,
                      PURPLE, REQUEST_FIELD_DATASHEET, PurpleRequestField)
diff --git a/libpurple/request/purplerequestfielddatasheet.c b/libpurple/request/purplerequestfielddatasheet.c
--- a/libpurple/request/purplerequestfielddatasheet.c
+++ b/libpurple/request/purplerequestfielddatasheet.c
@@ -15,13 +15,11 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <glib/gi18n-lib.h>
 
-#include "glibcompat.h"
 #include "purplerequestfield.h"
 #include "purplerequestfielddatasheet.h"
 
diff --git a/libpurple/request/purplerequestfieldimage.h b/libpurple/request/purplerequestfieldimage.h
--- a/libpurple/request/purplerequestfieldimage.h
+++ b/libpurple/request/purplerequestfieldimage.h
@@ -27,8 +27,6 @@
 #ifndef PURPLE_REQUEST_FIELD_IMAGE_H
 #define PURPLE_REQUEST_FIELD_IMAGE_H
 
-#include <stdlib.h>
-
 #include <glib.h>
 #include <glib-object.h>
 
@@ -36,6 +34,8 @@
  * PurpleRequestFieldImage:
  *
  * An image request field.
+ *
+ * Since: 3.0.0
  */
 typedef struct _PurpleRequestFieldImage PurpleRequestFieldImage;
 
diff --git a/libpurple/request/purplerequestfieldimage.c b/libpurple/request/purplerequestfieldimage.c
--- a/libpurple/request/purplerequestfieldimage.c
+++ b/libpurple/request/purplerequestfieldimage.c
@@ -15,13 +15,11 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <glib/gi18n-lib.h>
 
-#include "glibcompat.h"
 #include "purplerequestfield.h"
 #include "purplerequestfieldimage.h"
 
@@ -44,12 +42,12 @@ enum {
 };
 static GParamSpec *properties[N_PROPERTIES] = {NULL, };
 
+/******************************************************************************
+ * GObject Implementation
+ *****************************************************************************/
 G_DEFINE_TYPE(PurpleRequestFieldImage, purple_request_field_image,
               PURPLE_TYPE_REQUEST_FIELD)
 
-/******************************************************************************
- * GObject Implementation
- *****************************************************************************/
 static void
 purple_request_field_image_get_property(GObject *obj, guint param_id,
                                         GValue *value, GParamSpec *pspec)
diff --git a/libpurple/request/purplerequestfieldint.h b/libpurple/request/purplerequestfieldint.h
--- a/libpurple/request/purplerequestfieldint.h
+++ b/libpurple/request/purplerequestfieldint.h
@@ -27,22 +27,20 @@
 #ifndef PURPLE_REQUEST_FIELD_INT_H
 #define PURPLE_REQUEST_FIELD_INT_H
 
-#include <stdlib.h>
-
 #include <glib.h>
 #include <glib-object.h>
 
+#include "purplerequestfield.h"
+
+G_BEGIN_DECLS
+
 /**
  * PurpleRequestFieldInt:
  *
  * An integer request field.
+ *
+ * Since: 3.0.0
  */
-typedef struct _PurpleRequestFieldInt PurpleRequestFieldInt;
-
-#include "purplerequestfield.h"
-
-G_BEGIN_DECLS
-
 #define PURPLE_TYPE_REQUEST_FIELD_INT (purple_request_field_int_get_type())
 G_DECLARE_FINAL_TYPE(PurpleRequestFieldInt, purple_request_field_int,
                      PURPLE, REQUEST_FIELD_INT, PurpleRequestField)
diff --git a/libpurple/request/purplerequestfieldint.c b/libpurple/request/purplerequestfieldint.c
--- a/libpurple/request/purplerequestfieldint.c
+++ b/libpurple/request/purplerequestfieldint.c
@@ -15,18 +15,13 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <glib/gi18n-lib.h>
 
-#include "glibcompat.h"
-#include "request.h"
-#include "request/purplerequestfieldint.h"
-#include "debug.h"
-#include "purplekeyvaluepair.h"
-#include "purpleprivate.h"
+#include "purplerequestfield.h"
+#include "purplerequestfieldint.h"
 
 struct _PurpleRequestFieldInt {
 	PurpleRequestField parent;
@@ -246,7 +241,8 @@ purple_request_field_int_set_value(Purpl
 	g_return_if_fail(PURPLE_IS_REQUEST_FIELD_INT(field));
 
 	if(value < field->lower_bound || value > field->upper_bound) {
-		purple_debug_error("request", "Int value out of bounds\n");
+		g_warning("Int value %d out of bounds (%d, %d)", value,
+		          field->lower_bound, field->upper_bound);
 		return;
 	}
 
diff --git a/libpurple/request/purplerequestfieldlabel.h b/libpurple/request/purplerequestfieldlabel.h
--- a/libpurple/request/purplerequestfieldlabel.h
+++ b/libpurple/request/purplerequestfieldlabel.h
@@ -27,22 +27,20 @@
 #ifndef PURPLE_REQUEST_FIELD_LABEL_H
 #define PURPLE_REQUEST_FIELD_LABEL_H
 
-#include <stdlib.h>
-
 #include <glib.h>
 #include <glib-object.h>
 
+#include "purplerequestfield.h"
+
+G_BEGIN_DECLS
+
 /**
  * PurpleRequestFieldLabel:
  *
  * A label request field.
+ *
+ * Since: 3.0.0
  */
-typedef struct _PurpleRequestFieldLabel PurpleRequestFieldLabel;
-
-#include "purplerequestfield.h"
-
-G_BEGIN_DECLS
-
 #define PURPLE_TYPE_REQUEST_FIELD_LABEL (purple_request_field_label_get_type())
 G_DECLARE_FINAL_TYPE(PurpleRequestFieldLabel, purple_request_field_label,
                      PURPLE, REQUEST_FIELD_LABEL, PurpleRequestField)
diff --git a/libpurple/request/purplerequestfieldlabel.c b/libpurple/request/purplerequestfieldlabel.c
--- a/libpurple/request/purplerequestfieldlabel.c
+++ b/libpurple/request/purplerequestfieldlabel.c
@@ -15,15 +15,13 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <glib/gi18n-lib.h>
 
-#include "glibcompat.h"
 #include "purplerequestfield.h"
-#include "request/purplerequestfieldlabel.h"
+#include "purplerequestfieldlabel.h"
 
 struct _PurpleRequestFieldLabel {
 	PurpleRequestField parent;
diff --git a/libpurple/request/purplerequestfieldlist.h b/libpurple/request/purplerequestfieldlist.h
--- a/libpurple/request/purplerequestfieldlist.h
+++ b/libpurple/request/purplerequestfieldlist.h
@@ -27,22 +27,20 @@
 #ifndef PURPLE_REQUEST_FIELD_LIST_H
 #define PURPLE_REQUEST_FIELD_LIST_H
 
-#include <stdlib.h>
-
 #include <glib.h>
 #include <glib-object.h>
 
+#include "purplerequestfield.h"
+
+G_BEGIN_DECLS
+
 /**
  * PurpleRequestFieldList:
  *
  * A list request field.
+ *
+ * Since: 3.0.0
  */
-typedef struct _PurpleRequestFieldList PurpleRequestFieldList;
-
-#include "purplerequestfield.h"
-
-G_BEGIN_DECLS
-
 #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)
diff --git a/libpurple/request/purplerequestfieldlist.c b/libpurple/request/purplerequestfieldlist.c
--- a/libpurple/request/purplerequestfieldlist.c
+++ b/libpurple/request/purplerequestfieldlist.c
@@ -15,16 +15,13 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <glib/gi18n-lib.h>
 
-#include "glibcompat.h"
 #include "purplerequestfield.h"
-#include "request/purplerequestfieldlist.h"
-#include "debug.h"
+#include "purplerequestfieldlist.h"
 #include "purplekeyvaluepair.h"
 
 struct _PurpleRequestFieldList {
@@ -201,10 +198,8 @@ purple_request_field_list_add_selected(P
 	g_return_if_fail(item  != NULL);
 
 	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)));
+		g_warning("More than one item added to non-multi-select field %s",
+		          purple_request_field_get_id(PURPLE_REQUEST_FIELD(field)));
 		return;
 	}
 
@@ -235,10 +230,8 @@ purple_request_field_list_set_selected(P
 	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(PURPLE_REQUEST_FIELD(field)));
+		g_warning("More than one item added to non-multi-select field %s",
+		          purple_request_field_get_id(PURPLE_REQUEST_FIELD(field)));
 		return;
 	}
 
diff --git a/libpurple/request/purplerequestfieldstring.h b/libpurple/request/purplerequestfieldstring.h
--- a/libpurple/request/purplerequestfieldstring.h
+++ b/libpurple/request/purplerequestfieldstring.h
@@ -27,22 +27,20 @@
 #ifndef PURPLE_REQUEST_FIELD_STRING_H
 #define PURPLE_REQUEST_FIELD_STRING_H
 
-#include <stdlib.h>
-
 #include <glib.h>
 #include <glib-object.h>
 
 #include "purplerequestfield.h"
 
+G_BEGIN_DECLS
+
 /**
  * PurpleRequestFieldString:
  *
  * A string request field.
+ *
+ * Since: 3.0.0
  */
-typedef struct _PurpleRequestFieldString PurpleRequestFieldString;
-
-G_BEGIN_DECLS
-
 #define PURPLE_TYPE_REQUEST_FIELD_STRING (purple_request_field_string_get_type())
 G_DECLARE_FINAL_TYPE(PurpleRequestFieldString, purple_request_field_string,
                      PURPLE, REQUEST_FIELD_STRING, PurpleRequestField)
@@ -58,10 +56,7 @@ G_DECLARE_FINAL_TYPE(PurpleRequestFieldS
  *
  * Returns: (transfer full): The new field.
  */
-PurpleRequestField *purple_request_field_string_new(const char *id,
-												const char *text,
-												const char *default_value,
-												gboolean multiline);
+PurpleRequestField *purple_request_field_string_new(const char *id, const char *text, const char *default_value, gboolean multiline);
 
 /**
  * purple_request_field_string_set_default_value:
@@ -143,8 +138,7 @@ gboolean purple_request_field_string_is_
  *
  * Returns: TRUE, if field contains valid email address.
  */
-gboolean purple_request_field_email_validator(PurpleRequestField *field,
-	gchar **errmsg, void *user_data);
+gboolean purple_request_field_email_validator(PurpleRequestField *field, char **errmsg, gpointer user_data);
 
 /**
  * purple_request_field_alphanumeric_validator:
@@ -159,8 +153,7 @@ gboolean purple_request_field_email_vali
  *
  * 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_alphanumeric_validator(PurpleRequestField *field, char **errmsg, gpointer allowed_characters);
 
 G_END_DECLS
 
diff --git a/libpurple/request/purplerequestfieldstring.c b/libpurple/request/purplerequestfieldstring.c
--- a/libpurple/request/purplerequestfieldstring.c
+++ b/libpurple/request/purplerequestfieldstring.c
@@ -15,13 +15,11 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <glib/gi18n-lib.h>
 
-#include "glibcompat.h"
 #include "purplerequestfield.h"
 #include "purplerequestfieldstring.h"
 
