| 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 |