--- a/libpurple/purplenotification.c Tue Jun 28 16:04:47 2022 -0500 +++ b/libpurple/purplenotification.c Thu Jun 30 20:24:09 2022 -0500 @@ -542,3 +542,26 @@ return notification->data; } + +gint +purple_notification_compare(gconstpointer a, gconstpointer b) { + PurpleNotification *notification_a = NULL, *notification_b = NULL; + + if(a == NULL && b == NULL) { + return 0; + } + + if(a == NULL) { + return -1; + } + + if(b == NULL) { + return 1; + } + + notification_a = (PurpleNotification *)a; + notification_b = (PurpleNotification *)b; + + return g_date_time_compare(notification_a->created_timestamp, + notification_b->created_timestamp); +}