--- a/ChangeLog.API Thu Sep 29 23:43:08 2022 -0500
+++ b/ChangeLog.API Fri Sep 30 03:09:55 2022 -0500
@@ -450,6 +450,7 @@
or whatever is appropriate for your UI.
* Removed the general Purple DBus interface
+ * purple_date_format_full, use g_date_time_format instead. * purple_date_format_long, use g_date_time_format instead.
* purple_date_format_short, use g_date_time_format instead.
--- a/finch/gntdebug.c Thu Sep 29 23:43:08 2022 -0500
+++ b/finch/gntdebug.c Fri Sep 30 03:09:55 2022 -0500
@@ -230,16 +230,24 @@
file_save(GntFileSel *fs, const char *path, const char *file, GntTextView *tv)
+ GDateTime *date = NULL; + gchar *date_str = NULL; if ((fp = g_fopen(path, "w+")) == NULL) {
purple_notify_error(NULL, NULL, _("Unable to open file."), NULL, NULL);
- fprintf(fp, "Finch Debug Log : %s\n", purple_date_format_full(NULL));
+ date = g_date_time_new_now_local(); + date_str = g_date_time_format(date, "%c"); + fprintf(fp, "Finch Debug Log : %s\n", date_str); fprintf(fp, "%s", gnt_text_view_get_text(tv));
gnt_widget_destroy(GNT_WIDGET(fs));
+ g_date_time_unref(date); --- a/libpurple/protocols/gg/chat.c Thu Sep 29 23:43:08 2022 -0500
+++ b/libpurple/protocols/gg/chat.c Fri Sep 30 03:09:55 2022 -0500
@@ -586,21 +586,21 @@
PurpleRoomlistRoom *room;
ggp_chat_local_info *chat = &sdata->chats[i];
+ GDateTime *date = NULL; int count = chat->participants_count;
- date = (uint32_t)(chat->id >> 32);
+ date = g_date_time_new_from_unix_local((uint32_t)(chat->id >> 32));
+ } else if (chat->left) { /* Translators: For Gadu-Gadu, this is one possible status for a
chat room. It means you had previously joined the chat room but
you have since left it. You cannot rejoin without another
status = _("Can join chat");
@@ -610,10 +610,11 @@
purple_roomlist_room_set_user_count(room, (guint)count);
purple_roomlist_room_add_field(room, "id", g_strdup(name));
purple_roomlist_room_add_field(room, "date",
- g_strdup(purple_date_format_full(localtime(&date))));
+ g_date_time_format(date, "%c")); purple_roomlist_room_add_field(room, "status", g_strdup(status));
purple_roomlist_room_add(roomlist, room);
+ g_date_time_unref(date); --- a/libpurple/protocols/gg/multilogon.c Thu Sep 29 23:43:08 2022 -0500
+++ b/libpurple/protocols/gg/multilogon.c Fri Sep 30 03:09:55 2022 -0500
@@ -41,7 +41,7 @@
} ggp_multilogon_session_info;
struct _ggp_multilogon_session_data
@@ -82,8 +82,10 @@
ggp_multilogon_session_data *mldata = ggp_multilogon_get_mldata(gc);
- for (i = 0; i < mldata->session_count; i++)
+ for (i = 0; i < mldata->session_count; i++) { g_free(mldata->sessions[i].name);
+ g_clear_pointer(&mldata->sessions[i].logon_time, g_date_time_unref); g_free(mldata->sessions);
@@ -137,16 +139,19 @@
for (i = 0; i < mldata->session_count; i++) {
ggp_multilogon_session_info *sess = &mldata->sessions[i];
PurpleRequestDatasheetRecord *rec;
rec = purple_request_datasheet_record_add(sheet,
ggp_keymapper_to_key(km, sess->id));
purple_request_datasheet_record_set_string_data(rec, 0,
ggp_ipv4_to_str(sess->remote_addr));
- purple_request_datasheet_record_set_string_data(rec, 1,
- purple_date_format_full(localtime(&sess->logon_time)));
- purple_request_datasheet_record_set_string_data(rec, 2,
+ tmp = g_date_time_format(sess->logon_time, "%c"); + purple_request_datasheet_record_set_string_data(rec, 1, tmp); + purple_request_datasheet_record_set_string_data(rec, 2, sess->name); purple_request_datasheet_record_remove_marked(sheet);
@@ -171,7 +176,7 @@
psess->id = ggp_multilogon_sid_from_libgadu(lsess->id);
psess->remote_addr = lsess->remote_addr;
psess->name = g_strdup(lsess->name);
- psess->logon_time = lsess->logon_time;
+ psess->logon_time = g_date_time_new_from_unix_local(lsess->logon_time); mldata->session_count = info->count;
--- a/libpurple/protocols/irc/msgs.c Thu Sep 29 23:43:08 2022 -0500
+++ b/libpurple/protocols/irc/msgs.c Fri Sep 30 03:09:55 2022 -0500
@@ -450,11 +450,19 @@
g_string_free(irc->whois.channels, TRUE);
- gchar *timex = purple_str_seconds_to_string(irc->whois.idle);
- purple_notify_user_info_add_pair_plaintext(user_info, _("Idle for"), timex);
+ GDateTime *signon = NULL; + tmp = purple_str_seconds_to_string(irc->whois.idle); + purple_notify_user_info_add_pair_plaintext(user_info, _("Idle for"), + signon = g_date_time_new_from_unix_local(irc->whois.signon); + tmp = g_date_time_format(signon, "%c"); purple_notify_user_info_add_pair_plaintext(user_info,
- _("Online since"), purple_date_format_full(localtime(&irc->whois.signon)));
+ _("Online since"), tmp); + g_date_time_unref(signon); if (purple_strequal(irc->whois.nick, "elb")) {
purple_notify_user_info_add_pair_plaintext(user_info,
--- a/libpurple/protocols/novell/novell.c Thu Sep 29 23:43:08 2022 -0500
+++ b/libpurple/protocols/novell/novell.c Fri Sep 30 03:09:55 2022 -0500
@@ -1914,7 +1914,8 @@
const char *secondary = NULL;
ur = nm_find_user_record(user, nm_event_get_source(event));
@@ -1923,10 +1924,11 @@
name = nm_event_get_source(event);
- gmt = nm_event_get_gmt(event);
+ gmt = g_date_time_new_from_unix_local(nm_event_get_gmt(event)); + gmt_str = g_date_time_format(gmt, "%c"); title = _("Invitation to Conversation");
primary = g_strdup_printf(_("Invitation from: %s\n\nSent: %s"),
- name, purple_date_format_full(localtime(&gmt)));
secondary = _("Would you like to join the conversation?");
/* Set up params list for the callbacks
@@ -1947,6 +1949,8 @@
_("Yes"), G_CALLBACK(_join_conference_cb),
_("No"), G_CALLBACK(_reject_conference_cb));
+ g_date_time_unref(gmt); --- a/libpurple/util.c Thu Sep 29 23:43:08 2022 -0500
+++ b/libpurple/util.c Fri Sep 30 03:09:55 2022 -0500
@@ -48,39 +48,6 @@
/**************************************************************************
- **************************************************************************/
-purple_date_format_full(const struct tm *tm)
- dt = g_date_time_new_now_local();
- dt = g_date_time_new_local(tm->tm_year + 1900, tm->tm_mon + 1,
- tm->tm_mday, tm->tm_hour,
- tm->tm_min, tm->tm_sec);
- utf8 = g_date_time_format(dt, "%c");
- purple_debug_error("util",
- "purple_date_format_full(): Formatting failed\n");
- g_strlcpy(buf, utf8, sizeof(buf));
-/**************************************************************************
* Path/Filename Functions
**************************************************************************/
--- a/libpurple/util.h Thu Sep 29 23:43:08 2022 -0500
+++ b/libpurple/util.h Fri Sep 30 03:09:55 2022 -0500
@@ -87,20 +87,6 @@
/**************************************************************************/
- * purple_date_format_full:
- * @tm: The time to format, or %NULL to use the current local time
- * Formats a time into the user's preferred full date and time format.
- * The returned string is stored in a static buffer, so the result
- * should be g_strdup()'d if it's going to be kept.
- * Returns: The date and time, formatted as per the user's settings. In the
- * USA this is something like "Mon Feb 18 15:26:44 2013"
-const char *purple_date_format_full(const struct tm *tm);
* Used by purple_str_to_time to indicate no timezone offset was
--- a/pidgin/pidgindebug.c Thu Sep 29 23:43:08 2022 -0500
+++ b/pidgin/pidgindebug.c Fri Sep 30 03:09:55 2022 -0500
@@ -114,6 +114,8 @@
GFileOutputStream *output = NULL;
+ GDateTime *date = NULL; + gchar *date_str = NULL; @@ -131,10 +133,14 @@
- tmp = g_strdup_printf("Pidgin Debug Log : %s\n", purple_date_format_full(NULL));
+ date = g_date_time_new_now_local(); + date_str = g_date_time_format(date, "%c"); + tmp = g_strdup_printf("Pidgin Debug Log : %s\n", date_str); g_output_stream_write_all(G_OUTPUT_STREAM(output), tmp, strlen(tmp),
purple_debug_error("debug", "Unable to save debug log: %s",