# HG changeset patch
# Node ID f36d6d9bd4b51e906caea1a7984f5c15d5eecd14
# Parent  595a5f31003a2899534d24cc655ef757ec97d4db
diff --git a/libpurple/purplenotification.c b/libpurple/purplenotification.c
--- a/libpurple/purplenotification.c
+++ b/libpurple/purplenotification.c
@@ -99,6 +99,39 @@
  * GObject Implementation
  *****************************************************************************/
 static void
+purple_notification_constructed(GObject *obj) {
+	PurpleNotification *notification = NULL;
+	PurpleNotificationPrivate *priv = NULL;
+
+	G_OBJECT_CLASS(purple_notification_parent_class)->constructed(obj);
+
+	notification = PURPLE_NOTIFICATION(obj);
+	priv = purple_notification_get_instance_private(notification);
+
+	if(priv->created_timestamp == NULL) {
+		priv->created_timestamp = g_date_time_new_now_local();
+	}
+}
+
+static void
+purple_notification_finalize(GObject *obj) {
+	PurpleNotification *notification = PURPLE_NOTIFICATION(obj);
+	PurpleNotificationPrivate *priv = NULL;
+
+	priv = purple_notification_get_instance_private(notification);
+
+	g_clear_pointer(&priv->id, g_free);
+	g_clear_object(&priv->account);
+
+	birb_date_time_clear(&priv->created_timestamp);
+	g_clear_pointer(&priv->title, g_free);
+	g_clear_pointer(&priv->subtitle, g_free);
+	g_clear_pointer(&priv->icon_name, g_free);
+
+	G_OBJECT_CLASS(purple_notification_parent_class)->finalize(obj);
+}
+
+static void
 purple_notification_get_property(GObject *obj, guint param_id, GValue *value,
                                  GParamSpec *pspec)
 {
@@ -197,24 +230,6 @@
 }
 
 static void
-purple_notification_finalize(GObject *obj) {
-	PurpleNotification *notification = PURPLE_NOTIFICATION(obj);
-	PurpleNotificationPrivate *priv = NULL;
-
-	priv = purple_notification_get_instance_private(notification);
-
-	g_clear_pointer(&priv->id, g_free);
-	g_clear_object(&priv->account);
-
-	birb_date_time_clear(&priv->created_timestamp);
-	g_clear_pointer(&priv->title, g_free);
-	g_clear_pointer(&priv->subtitle, g_free);
-	g_clear_pointer(&priv->icon_name, g_free);
-
-	G_OBJECT_CLASS(purple_notification_parent_class)->finalize(obj);
-}
-
-static void
 purple_notification_init(G_GNUC_UNUSED PurpleNotification *notification) {
 }
 
@@ -222,9 +237,10 @@
 purple_notification_class_init(PurpleNotificationClass *klass) {
 	GObjectClass *obj_class = G_OBJECT_CLASS(klass);
 
+	obj_class->constructed = purple_notification_constructed;
+	obj_class->finalize = purple_notification_finalize;
 	obj_class->get_property = purple_notification_get_property;
 	obj_class->set_property = purple_notification_set_property;
-	obj_class->finalize = purple_notification_finalize;
 
 	/**
 	 * PurpleNotification:id:
@@ -444,18 +460,6 @@
 	}
 }
 
-void
-purple_notification_set_created_timestamp_now(PurpleNotification *notification)
-{
-	GDateTime *timestamp = NULL;
-
-	g_return_if_fail(PURPLE_IS_NOTIFICATION(notification));
-
-	timestamp = g_date_time_new_now_local();
-	purple_notification_set_created_timestamp(notification, timestamp);
-	g_date_time_unref(timestamp);
-}
-
 const char *
 purple_notification_get_title(PurpleNotification *notification) {
 	PurpleNotificationPrivate *priv = NULL;
diff --git a/libpurple/purplenotification.h b/libpurple/purplenotification.h
--- a/libpurple/purplenotification.h
+++ b/libpurple/purplenotification.h
@@ -147,17 +147,6 @@
 void purple_notification_set_created_timestamp(PurpleNotification *notification, GDateTime *timestamp);
 
 /**
- * purple_notification_set_created_timestamp_now:
- * @notification: The instance.
- *
- * Sets the created timestamp of @notification to the current local time.
- *
- * Since: 3.0
- */
-PURPLE_AVAILABLE_IN_3_0
-void purple_notification_set_created_timestamp_now(PurpleNotification *notification);
-
-/**
  * purple_notification_get_title:
  * @notification: The instance.
  *
diff --git a/libpurple/tests/test_notification.c b/libpurple/tests/test_notification.c
--- a/libpurple/tests/test_notification.c
+++ b/libpurple/tests/test_notification.c
@@ -40,12 +40,7 @@
 	id = purple_notification_get_id(notification);
 	g_assert_nonnull(id);
 
-	/* Make sure that the created-timestamp was not set. */
-	created_timestamp = purple_notification_get_created_timestamp(notification);
-	g_assert_null(created_timestamp);
-
-	/* Make sure set_created_timestamp_now works. */
-	purple_notification_set_created_timestamp_now(notification);
+	/* Make sure that the created-timestamp was set. */
 	created_timestamp = purple_notification_get_created_timestamp(notification);
 	g_assert_nonnull(created_timestamp);
 
