comparison pidgin/plugins/timestamp_format.c @ 15565:45d3dd67fa13

With the refactoring I did, it's now possible to reach timestamp_cb_common with conv == NULL. It happens with system logs. I've reworked the code accordingly to avoid an assertion failure.
author Richard Laager <rlaager@wiktel.com>
date Mon, 05 Feb 2007 05:28:54 +0000
parents b15cc37605c4
children b6615958d87c
comparison
equal deleted inserted replaced
15564:2286aac43694 15565:45d3dd67fa13
55 time_t t, 55 time_t t,
56 gboolean show_date, 56 gboolean show_date,
57 gboolean force, 57 gboolean force,
58 const char *dates) 58 const char *dates)
59 { 59 {
60 g_return_val_if_fail(conv != NULL, NULL);
61 g_return_val_if_fail(dates != NULL, NULL); 60 g_return_val_if_fail(dates != NULL, NULL);
62 61
63 if (show_date || 62 if (show_date ||
64 !strcmp(dates, "always") || 63 !strcmp(dates, "always") ||
65 (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT && !strcmp(dates, "chats"))) 64 (conv != NULL && gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT && !strcmp(dates, "chats")))
66 { 65 {
67 struct tm *tm = localtime(&t); 66 struct tm *tm = localtime(&t);
68 if (force) 67 if (force)
69 return g_strdup(gaim_utf8_strftime("%Y-%m-%d %H:%M:%S", tm)); 68 return g_strdup(gaim_utf8_strftime("%Y-%m-%d %H:%M:%S", tm));
70 else 69 else