# HG changeset patch # User Elliott Sales de Andrade # Date 1325495619 0 # Node ID 9e72389456f67df74929bd9c65eee7d4fd2e801f # Parent b659893018540d6259e4b0d7b1865254135dfe4b Ensure timestamps in header all all the same. diff -r b65989301854 -r 9e72389456f6 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Mon Jan 02 07:58:32 2012 +0000 +++ b/pidgin/gtkconv.c Mon Jan 02 09:13:39 2012 +0000 @@ -5045,6 +5045,8 @@ GString *str; const char *cur = text; const char *prev = cur; + time_t mtime; + struct tm *tm = NULL; if (text == NULL || *text == '\0') return NULL; @@ -5081,6 +5083,7 @@ } else if (g_str_has_prefix(cur, "%timeOpened")) { const char *tmp = cur + strlen("%timeOpened"); char *format = NULL; + if (*tmp == '{') { const char *end; tmp++; @@ -5090,11 +5093,22 @@ format = g_strndup(tmp, end - tmp); fin = end + 1; } - replace = purple_utf8_strftime(format ? format : "%X", NULL); + + if (!tm) { + mtime = time(NULL); + tm = localtime(&mtime); + } + + replace = purple_utf8_strftime(format ? format : "%X", tm); g_free(format); } else if (g_str_has_prefix(cur, "%dateOpened%")) { - replace = purple_date_format_short(NULL); + if (!tm) { + mtime = time(NULL); + tm = localtime(&mtime); + } + + replace = purple_date_format_short(tm); } else { cur++;