--- a/libpurple/status.c Thu Sep 29 03:48:09 2022 -0500
+++ b/libpurple/status.c Thu Sep 29 06:30:35 2022 -0500
@@ -301,6 +301,43 @@
+purple_status_type_new_with_attrsv(PurpleStatusPrimitive primitive, + const char *id, const char *name, + gboolean saveable, gboolean user_settable, + gboolean independent, guint n_attributes, + const char *attr_name[], + PurpleStatusType *status_type; + g_return_val_if_fail(primitive != PURPLE_STATUS_UNSET, NULL); + g_return_val_if_fail(attr_id != NULL, NULL); + g_return_val_if_fail(attr_name != NULL, NULL); + g_return_val_if_fail(attr_value != NULL, NULL); + status_type = purple_status_type_new_full(primitive, id, name, saveable, + user_settable, independent); + for(guint i = 0; i < n_attributes; i++) { + if(attr_id[i] == NULL || attr_name[i] == NULL || + purple_status_type_destroy(status_type); + g_return_val_if_fail(attr_id[i] != NULL, NULL); + g_return_val_if_fail(attr_name[i] != NULL, NULL); + g_return_val_if_fail(attr_value[i] != NULL, NULL); + status_type_add_attr(status_type, attr_id[i], attr_name[i], purple_status_type_destroy(PurpleStatusType *status_type)
--- a/libpurple/status.h Thu Sep 29 03:48:09 2022 -0500
+++ b/libpurple/status.h Thu Sep 29 06:30:35 2022 -0500
@@ -265,20 +265,19 @@
* purple_status_type_new_full:
- * @primitive: The primitive status type.
- * @id: The ID of the status type, or %NULL to use the id of
- * the primitive status type.
- * @name: The name presented to the user, or %NULL to use the
- * name of the primitive status type.
- * @saveable: TRUE if the information set for this status by the
- * user can be saved for future sessions.
- * @user_settable: TRUE if this is a status the user can manually set.
- * @independent: TRUE if this is an independent (non-exclusive)
+ * @primitive: The primitive status type. + * @id: The ID of the status type, or %NULL to use the id of the primitive + * @name: The name presented to the user, or %NULL to use the name of the + * primitive status type. + * @saveable: %TRUE if the information set for this status by the user can be + * saved for future sessions. + * @user_settable: %TRUE if this is a status the user can manually set. + * @independent: %TRUE if this is an independent (non-exclusive) status type. * Creates a new status type.
- * Returns: A new status type.
+ * Returns: (transfer full): A new status type. PurpleStatusType *purple_status_type_new_full(PurpleStatusPrimitive primitive,
const char *id, const char *name,
@@ -288,17 +287,17 @@
* purple_status_type_new:
- * @primitive: The primitive status type.
- * @id: The ID of the status type, or %NULL to use the id of
- * the primitive status type.
- * @name: The name presented to the user, or %NULL to use the
- * name of the primitive status type.
- * @user_settable: TRUE if this is a status the user can manually set.
+ * @primitive: The primitive status type. + * @id: The ID of the status type, or %NULL to use the id of the primitive + * @name: The name presented to the user, or %NULL to use the name of the + * primitive status type. + * @user_settable: %TRUE if this is a status the user can manually set. - * Creates a new status type with some default values (
- * saveable and not independent).
+ * Creates a new status type with some default values (saveable and not - * Returns: A new status type.
+ * Returns: (transfer full): A new status type. PurpleStatusType *purple_status_type_new(PurpleStatusPrimitive primitive,
const char *id, const char *name,
@@ -306,24 +305,23 @@
* purple_status_type_new_with_attrs:
- * @primitive: The primitive status type.
- * @id: The ID of the status type, or %NULL to use the id of
- * the primitive status type.
- * @name: The name presented to the user, or %NULL to use the
- * name of the primitive status type.
- * @saveable: TRUE if the information set for this status by the
- * user can be saved for future sessions.
- * @user_settable: TRUE if this is a status the user can manually set.
- * @independent: TRUE if this is an independent (non-exclusive)
- * @attr_id: The ID of the first attribute.
- * @attr_name: The name of the first attribute.
- * @attr_value: The value type of the first attribute.
- * @...: Additional attribute information.
+ * @primitive: The primitive status type. + * @id: The ID of the status type, or %NULL to use the id of the primitive + * @name: The name presented to the user, or %NULL to use the name of the + * primitive status type. + * @saveable: %TRUE if the information set for this status by the user can be + * saved for future sessions. + * @user_settable: %TRUE if this is a status the user can manually set. + * @independent: %TRUE if this is an independent (non-exclusive) status type. + * @attr_id: The ID of the first attribute. + * @attr_name: The name of the first attribute. + * @attr_value: The value type of the first attribute. + * @...: Additional attribute information. * Creates a new status type with attributes.
- * Returns: A new status type.
+ * Returns: (transfer full): A new status type. PurpleStatusType *purple_status_type_new_with_attrs(PurpleStatusPrimitive primitive,
@@ -336,6 +334,39 @@
GValue *attr_value, ...) G_GNUC_NULL_TERMINATED;
+ * purple_status_type_new_with_attrsv: (rename-to purple_status_type_new_with_attrs): + * @primitive: The primitive status type. + * @id: The ID of the status type, or %NULL to use the id of the primitive + * @name: The name presented to the user, or %NULL to use the name of the + * primitive status type. + * @saveable: %TRUE if the information set for this status by the user can be + * saved for future sessions. + * @user_settable: %TRUE if this is a status the user can manually set. + * @independent: %TRUE if this is an independent (non-exclusive) status type. + * @n_attributes: The number of attributes. + * @attr_id: (array length=n_attributes): The IDs of the attributes. + * @attr_name: (array length=n_attributes): The names of the attributes. + * @attr_value: (array length=n_attributes): The value types of the attributes. + * Creates a new status type with attributes. + * Returns: (transfer full): A new status type. +PurpleStatusType *purple_status_type_new_with_attrsv(PurpleStatusPrimitive primitive, + gboolean user_settable, + const gchar *attr_id[], + const gchar *attr_name[], * purple_status_type_destroy:
* @status_type: The status type to destroy.