# HG changeset patch
# Node ID d8a723909e0038354adf2046da63e58659c715cb
# Parent  9a05207c3944acab6f945ab5821c5f45f1d9c6a4
diff --git a/libpurple/meson.build b/libpurple/meson.build
--- a/libpurple/meson.build
+++ b/libpurple/meson.build
@@ -242,7 +242,6 @@
 	'purplecontactinfo.h',
 	'purpleconversation.h',
 	'purplefiletransfer.h',
-	'purplenotification.h',
 	'purpleplugininfo.h',
 	'purplepresence.h',
 	'purpleprotocol.h',
diff --git a/libpurple/purpleaccount.c b/libpurple/purpleaccount.c
--- a/libpurple/purpleaccount.c
+++ b/libpurple/purpleaccount.c
@@ -33,6 +33,7 @@
 #include "purpleconversationmanager.h"
 #include "purplecredentialmanager.h"
 #include "purplenotification.h"
+#include "purplenotificationconnectionerror.h"
 #include "purplenotificationmanager.h"
 #include "purpleprivate.h"
 #include "purpleprotocolmanager.h"
@@ -1623,7 +1624,7 @@
 
 	if(info != NULL) {
 		account->error_notification =
-			purple_notification_new_from_connection_error(account, info);
+			purple_notification_connection_error_new(NULL, account, info);
 
 		purple_notification_manager_add(manager, account->error_notification);
 	}
diff --git a/libpurple/purplenotification.c b/libpurple/purplenotification.c
--- a/libpurple/purplenotification.c
+++ b/libpurple/purplenotification.c
@@ -34,7 +34,6 @@
 
 typedef struct {
 	char *id;
-	PurpleNotificationType type;
 	PurpleAccount *account;
 
 	GDateTime *created_timestamp;
@@ -61,7 +60,6 @@
 enum {
 	PROP_0,
 	PROP_ID,
-	PROP_TYPE,
 	PROP_ACCOUNT,
 	PROP_CREATED_TIMESTAMP,
 	PROP_TITLE,
@@ -70,8 +68,6 @@
 	PROP_READ,
 	PROP_INTERACTIVE,
 	PROP_PERSISTENT,
-	PROP_DATA,
-	PROP_DATA_DESTROY_FUNC,
 	N_PROPERTIES,
 };
 static GParamSpec *properties[N_PROPERTIES] = {NULL, };
@@ -99,50 +95,6 @@
 	g_object_notify_by_pspec(G_OBJECT(notification), properties[PROP_ID]);
 }
 
-static void
-purple_notification_set_notification_type(PurpleNotification *notification,
-                                          PurpleNotificationType type)
-{
-	PurpleNotificationPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_NOTIFICATION(notification));
-
-	priv = purple_notification_get_instance_private(notification);
-
-	priv->type = type;
-
-	g_object_notify_by_pspec(G_OBJECT(notification), properties[PROP_TYPE]);
-}
-
-static void
-purple_notification_set_data(PurpleNotification *notification, gpointer data) {
-	PurpleNotificationPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_NOTIFICATION(notification));
-
-	priv = purple_notification_get_instance_private(notification);
-
-	priv->data = data;
-
-	g_object_notify_by_pspec(G_OBJECT(notification), properties[PROP_DATA]);
-}
-
-static void
-purple_notification_set_data_destroy_func(PurpleNotification *notification,
-                                          GDestroyNotify data_destroy_func)
-{
-	PurpleNotificationPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_NOTIFICATION(notification));
-
-	priv = purple_notification_get_instance_private(notification);
-
-	priv->data_destroy_func = data_destroy_func;
-
-	g_object_notify_by_pspec(G_OBJECT(notification),
-	                         properties[PROP_DATA_DESTROY_FUNC]);
-}
-
 /******************************************************************************
  * GObject Implementation
  *****************************************************************************/
@@ -157,12 +109,6 @@
 		g_value_set_string(value,
 		                   purple_notification_get_id(notification));
 		break;
-	case PROP_TYPE:
-		G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-		g_value_set_enum(value,
-		                 purple_notification_get_notification_type(notification));
-		G_GNUC_END_IGNORE_DEPRECATIONS
-		break;
 	case PROP_ACCOUNT:
 		g_value_set_object(value,
 		                   purple_notification_get_account(notification));
@@ -195,12 +141,6 @@
 		g_value_set_boolean(value,
 		                    purple_notification_get_persistent(notification));
 		break;
-	case PROP_DATA:
-		G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-		g_value_set_pointer(value,
-		                    purple_notification_get_data(notification));
-		G_GNUC_END_IGNORE_DEPRECATIONS
-		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
 		break;
@@ -218,10 +158,6 @@
 		purple_notification_set_id(notification,
 		                           g_value_get_string(value));
 		break;
-	case PROP_TYPE:
-		purple_notification_set_notification_type(notification,
-		                                          g_value_get_enum(value));
-		break;
 	case PROP_ACCOUNT:
 		purple_notification_set_account(notification,
 		                                g_value_get_object(value));
@@ -254,14 +190,6 @@
 		purple_notification_set_persistent(notification,
 		                                   g_value_get_boolean(value));
 		break;
-	case PROP_DATA:
-		purple_notification_set_data(notification,
-		                             g_value_get_pointer(value));
-		break;
-	case PROP_DATA_DESTROY_FUNC:
-		purple_notification_set_data_destroy_func(notification,
-		                                          g_value_get_pointer(value));
-		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
 		break;
@@ -283,10 +211,6 @@
 	g_clear_pointer(&priv->subtitle, g_free);
 	g_clear_pointer(&priv->icon_name, g_free);
 
-	if(priv->data_destroy_func != NULL) {
-		priv->data_destroy_func(priv->data);
-	}
-
 	G_OBJECT_CLASS(purple_notification_parent_class)->finalize(obj);
 }
 
@@ -319,20 +243,6 @@
 		G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
 
 	/**
-	 * PurpleNotification:type:
-	 *
-	 * The [enum@NotificationType] of this notification.
-	 *
-	 * Since: 3.0
-	 */
-	properties[PROP_TYPE] = g_param_spec_enum(
-		"type", NULL, NULL,
-		PURPLE_TYPE_NOTIFICATION_TYPE,
-		PURPLE_NOTIFICATION_TYPE_UNKNOWN,
-		G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_DEPRECATED |
-		G_PARAM_STATIC_STRINGS);
-
-	/**
 	 * PurpleNotification:account:
 	 *
 	 * An optional [class@Account] that this notification is for.
@@ -435,30 +345,6 @@
 		FALSE,
 		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 
-	/**
-	 * PurpleNotification:data:
-	 *
-	 * Data specific to the [enum@NotificationType] for the notification.
-	 *
-	 * Since: 3.0
-	 */
-	properties[PROP_DATA] = g_param_spec_pointer(
-		"data", NULL, NULL,
-		G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_DEPRECATED |
-		G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * PurpleNotification:data-destroy-func:
-	 *
-	 * A function to call to free [property@PurpleNotification:data].
-	 *
-	 * Since: 3.0
-	 */
-	properties[PROP_DATA_DESTROY_FUNC] = g_param_spec_pointer(
-		"data-destroy-func", NULL, NULL,
-		G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_DEPRECATED |
-		G_PARAM_STATIC_STRINGS);
-
 	g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
 
 	/**
@@ -486,32 +372,6 @@
  * Public API
  *****************************************************************************/
 PurpleNotification *
-purple_notification_new(PurpleNotificationType type, PurpleAccount *account,
-                        gpointer data, GDestroyNotify data_destroy_func)
-{
-	PurpleNotification *notification = NULL;
-	char *envvar = NULL;
-
-	/* This is temporary until this function gets replaced with the generic one
-	 * below.
-	 */
-	envvar = g_strdup(g_getenv("G_ENABLE_DIAGNOSTIC"));
-	g_unsetenv("G_ENABLE_DIAGNOSTIC");
-
-	notification = g_object_new(PURPLE_TYPE_NOTIFICATION,
-	                    "type", type,
-	                    "account", account,
-	                    "data", data,
-	                    "data-destroy-func", data_destroy_func,
-	                    NULL);
-
-	g_setenv("G_ENABLE_DIAGNOSTIC", envvar, FALSE);
-	g_free(envvar);
-
-	return notification;
-}
-
-PurpleNotification *
 purple_notification_new_generic(const char *id, const char *title) {
 	return g_object_new(PURPLE_TYPE_NOTIFICATION,
 	                    "id", id,
@@ -519,33 +379,6 @@
 	                    NULL);
 }
 
-PurpleNotification *
-purple_notification_new_from_add_contact_request(PurpleAddContactRequest *request)
-{
-	g_return_val_if_fail(PURPLE_IS_ADD_CONTACT_REQUEST(request), NULL);
-
-	return purple_notification_add_contact_new(NULL, request);
-}
-
-PurpleNotification *
-purple_notification_new_from_authorization_request(PurpleAuthorizationRequest *authorization_request)
-{
-	g_return_val_if_fail(PURPLE_IS_AUTHORIZATION_REQUEST(authorization_request),
-	                     NULL);
-
-	return purple_notification_authorization_request_new(NULL,
-	                                                     authorization_request);
-}
-
-PurpleNotification *
-purple_notification_new_from_connection_error(PurpleAccount *account,
-                                              PurpleConnectionErrorInfo *info)
-{
-	g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL);
-
-	return purple_notification_connection_error_new(NULL, account, info);
-}
-
 const char *
 purple_notification_get_id(PurpleNotification *notification) {
 	PurpleNotificationPrivate *priv = NULL;
@@ -557,18 +390,6 @@
 	return priv->id;
 }
 
-PurpleNotificationType
-purple_notification_get_notification_type(PurpleNotification *notification) {
-	PurpleNotificationPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_NOTIFICATION(notification),
-	                     PURPLE_NOTIFICATION_TYPE_UNKNOWN);
-
-	priv = purple_notification_get_instance_private(notification);
-
-	return priv->type;
-}
-
 PurpleAccount *
 purple_notification_get_account(PurpleNotification *notification) {
 	PurpleNotificationPrivate *priv = NULL;
@@ -801,17 +622,6 @@
 	}
 }
 
-gpointer
-purple_notification_get_data(PurpleNotification *notification) {
-	PurpleNotificationPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_NOTIFICATION(notification), NULL);
-
-	priv = purple_notification_get_instance_private(notification);
-
-	return priv->data;
-}
-
 int
 purple_notification_compare(gconstpointer a, gconstpointer b) {
 	PurpleNotification *notification_a = NULL;
diff --git a/libpurple/purplenotification.h b/libpurple/purplenotification.h
--- a/libpurple/purplenotification.h
+++ b/libpurple/purplenotification.h
@@ -38,43 +38,6 @@
 G_BEGIN_DECLS
 
 /**
- * PurpleNotificationType:
- * @PURPLE_NOTIFICATION_TYPE_UNKNOWN: This type is unknown.
- * @PURPLE_NOTIFICATION_TYPE_GENERIC: A generic notification that is just text
- *                                    that may have links.
- * @PURPLE_NOTIFICATION_TYPE_CONNECTION_ERROR: A notification that is for a
- *                                             connection error.
- * @PURPLE_NOTIFICATION_TYPE_AUTHORIZATION_REQUEST: A notification for a
- *                                                  contact authorization
- *                                                  request.
- * @PURPLE_NOTIFICATION_TYPE_ADD_CONTACT: A notification for when a contact add
- *                                        you to their contact list.
- * @PURPLE_NOTIFICATION_TYPE_FILE_TRANSFER: A notification for a file transfer.
- * @PURPLE_NOTIFICATION_TYPE_CHAT_INVITE: A notification when the user has been
- *                                        invited to a chat.
- * @PURPLE_NOTIFICATION_TYPE_MENTION: A notification that the user has been
- *                                    mentioned.
- * @PURPLE_NOTIFICATION_TYPE_REACTION: A notification when a reaction has been
- *                                     added to message.
- *
- * The different types of notifications.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_TYPE_IN_3_0
-typedef enum {
-    PURPLE_NOTIFICATION_TYPE_UNKNOWN,
-    PURPLE_NOTIFICATION_TYPE_GENERIC,
-    PURPLE_NOTIFICATION_TYPE_CONNECTION_ERROR,
-    PURPLE_NOTIFICATION_TYPE_AUTHORIZATION_REQUEST,
-    PURPLE_NOTIFICATION_TYPE_ADD_CONTACT,
-    PURPLE_NOTIFICATION_TYPE_FILE_TRANSFER,
-    PURPLE_NOTIFICATION_TYPE_CHAT_INVITE,
-    PURPLE_NOTIFICATION_TYPE_MENTION,
-    PURPLE_NOTIFICATION_TYPE_REACTION,
-} PurpleNotificationType;
-
-/**
  * PurpleNotification:
  *
  * An object that represents a notification.
@@ -97,26 +60,6 @@
 };
 
 /**
- * purple_notification_new:
- * @type: The [enum@NotificationType] of the notification.
- * @account: (nullable): The [class@Account] that created the notification if
- *           applicable.
- * @data: The data for the notification.
- * @data_destroy_func: A GDestroyNotify to call to free @data.
- *
- * Creates a new notification with the given properties. @account is optional.
- *
- * Once the notification is prepared, it should be added to a
- * [class@NotificationManager] to be presented to the user.
- *
- * Returns: (transfer full): The new notification.
- *
- * Since: 3.0
- */
-PURPLE_DEPRECATED_FOR(purple_notification_new_generic)
-PurpleNotification *purple_notification_new(PurpleNotificationType type, PurpleAccount *account, gpointer data, GDestroyNotify data_destroy_func);
-
-/**
  * purple_notification_new_generic:
  * @id: (nullable): An id for the notification.
  * @title: (nullable): The title for the notification.
@@ -136,55 +79,6 @@
 PurpleNotification *purple_notification_new_generic(const char *id, const char *title);
 
 /**
- * purple_notification_new_from_add_contact_request:
- * @request: (transfer full): The [class@AddContactRequest] instance.
- *
- * Creates a new [class@Notification] for @request. This helper will
- * automatically fill out the notification according to the information in
- * @request.
- *
- * Returns: (transfer full): The new notification.
- *
- * Since: 3.0
- *
- * Deprecated: 3.0
- */
-PURPLE_DEPRECATED_FOR(purple_notification_add_contact_new)
-PurpleNotification *purple_notification_new_from_add_contact_request(PurpleAddContactRequest *request);
-
-/**
- * purple_notification_new_from_authorization_request:
- * @authorization_request: (transfer full): The [class@AuthorizationRequest]
- *                         instance.
- *
- * Creates a new [class@Notification] for the @authorization_request. This
- * helper will automatically fill out the notification according to the
- * information in @authorization_request.
- *
- * Returns: (transfer full): The new notification.
- *
- * Since: 3.0
- */
-PURPLE_DEPRECATED_FOR(purple_notification_authorization_request_new)
-PurpleNotification *purple_notification_new_from_authorization_request(PurpleAuthorizationRequest *authorization_request);
-
-/**
- * purple_notification_new_from_connection_error:
- * @account: The [class@Purple.Account] that had the connection error.
- * @info: (transfer none): The [struct@Purple.ConnectionErrorInfo] for the error.
- *
- * Creates a new [class@Purple.Notification] for @account with the @info for
- * the connection. This helper will automatically fill out the notification
- * according to the given parameters.
- *
- * Returns: (transfer full): The new notification.
- *
- * Since: 3.0
- */
-PURPLE_DEPRECATED_FOR(purple_notification_connection_error_new)
-PurpleNotification *purple_notification_new_from_connection_error(PurpleAccount *account, PurpleConnectionErrorInfo *info);
-
-/**
  * purple_notification_get_id:
  * @notification: The instance.
  *
@@ -198,19 +92,6 @@
 const char *purple_notification_get_id(PurpleNotification *notification);
 
 /**
- * purple_notification_get_notification_type:
- * @notification: The instance.
- *
- * Gets the [enum@NotificationType] of @notification.
- *
- * Returns: The type of @notification.
- *
- * Since: 3.0
- */
-PURPLE_DEPRECATED
-PurpleNotificationType purple_notification_get_notification_type(PurpleNotification *notification);
-
-/**
  * purple_notification_get_account:
  * @notification: The instance.
  *
@@ -428,19 +309,6 @@
 void purple_notification_set_persistent(PurpleNotification *notification, gboolean persistent);
 
 /**
- * purple_notification_get_data:
- * @notification: The instance.
- *
- * Gets the data that @notification was created with.
- *
- * Returns: (transfer none): The data for @notification.
- *
- * Since: 3.0
- */
-PURPLE_DEPRECATED
-gpointer purple_notification_get_data(PurpleNotification *notification);
-
-/**
  * purple_notification_compare:
  * @a: The first notification to compare.
  * @b: The second notification to compare.
