# HG changeset patch # User Stu Tomlinson # Date 1178197936 0 # Node ID 422bcef3154cbbc4926a9022b5057ce404224715 # Parent f7466b0379e86631910f0fa64ff6f1496ba7506e Fix ticket #559: Message Timestamp Formats Parentheses Bug If you choose "Force traditional..." or set the date to be displayed always in the conversation window, there are no longer parentheses around the date/time. diff -r f7466b0379e8 -r 422bcef3154c pidgin/plugins/timestamp_format.c --- a/pidgin/plugins/timestamp_format.c Thu May 03 08:34:53 2007 +0000 +++ b/pidgin/plugins/timestamp_format.c Thu May 03 13:12:16 2007 +0000 @@ -58,7 +58,8 @@ time_t t, gboolean show_date, gboolean force, - const char *dates) + const char *dates, + gboolean parens) { g_return_val_if_fail(dates != NULL, NULL); @@ -68,15 +69,15 @@ { struct tm *tm = localtime(&t); if (force) - return g_strdup(purple_utf8_strftime("%Y-%m-%d %H:%M:%S", tm)); + return g_strdup_printf("%s%s%s", parens ? "(" : "", purple_utf8_strftime("%Y-%m-%d %H:%M:%S", tm), parens ? ")" : ""); else - return g_strdup(purple_date_format_long(tm)); + return g_strdup_printf("%s%s%s", parens ? "(" : "", purple_date_format_long(tm), parens ? ")" : ""); } if (force) { struct tm *tm = localtime(&t); - return g_strdup(purple_utf8_strftime("%H:%M:%S", tm)); + return g_strdup_printf("%s%s%s", parens ? "(" : "", purple_utf8_strftime("%H:%M:%S", tm), parens ? ")" : ""); } return NULL; @@ -92,7 +93,7 @@ g_return_val_if_fail(conv != NULL, NULL); - return timestamp_cb_common(conv, t, show_date, force, dates); + return timestamp_cb_common(conv, t, show_date, force, dates, TRUE); } static char *log_timestamp_cb(PurpleLog *log, time_t t, gboolean show_date, gpointer data) @@ -104,7 +105,7 @@ g_return_val_if_fail(log != NULL, NULL); - return timestamp_cb_common(log->conv, t, show_date, force, dates); + return timestamp_cb_common(log->conv, t, show_date, force, dates, FALSE); } static gboolean