| 29 |
29 |
| 30 ppref = gaim_plugin_pref_new_with_name_and_label( |
30 ppref = gaim_plugin_pref_new_with_name_and_label( |
| 31 "/plugins/gtk/timestamp_format/use_dates/conversation", |
31 "/plugins/gtk/timestamp_format/use_dates/conversation", |
| 32 _("Co_nversations:")); |
32 _("Co_nversations:")); |
| 33 gaim_plugin_pref_set_type(ppref, GAIM_PLUGIN_PREF_CHOICE); |
33 gaim_plugin_pref_set_type(ppref, GAIM_PLUGIN_PREF_CHOICE); |
| 34 gaim_plugin_pref_add_choice(ppref, "For Delayed Messages", "automatic"); |
34 gaim_plugin_pref_add_choice(ppref, "For delayed messages", "automatic"); |
| 35 gaim_plugin_pref_add_choice(ppref, "In Chats", "chats"); |
35 gaim_plugin_pref_add_choice(ppref, "For delayed messages and in chats", "chats"); |
| 36 gaim_plugin_pref_add_choice(ppref, "Always", "always"); |
36 gaim_plugin_pref_add_choice(ppref, "Always", "always"); |
| 37 gaim_plugin_pref_frame_add(frame, ppref); |
37 gaim_plugin_pref_frame_add(frame, ppref); |
| 38 |
38 |
| 39 ppref = gaim_plugin_pref_new_with_name_and_label( |
39 ppref = gaim_plugin_pref_new_with_name_and_label( |
| 40 "/plugins/gtk/timestamp_format/use_dates/log", |
40 "/plugins/gtk/timestamp_format/use_dates/log", |
| 41 _("_Logs:")); |
41 _("_Message Logs:")); |
| 42 gaim_plugin_pref_set_type(ppref, GAIM_PLUGIN_PREF_CHOICE); |
42 gaim_plugin_pref_set_type(ppref, GAIM_PLUGIN_PREF_CHOICE); |
| 43 gaim_plugin_pref_add_choice(ppref, "For Delayed Messages", "automatic"); |
43 gaim_plugin_pref_add_choice(ppref, "For delayed messages", "automatic"); |
| 44 gaim_plugin_pref_add_choice(ppref, "In Chats", "chats"); |
44 gaim_plugin_pref_add_choice(ppref, "For delayed messages and in chats", "chats"); |
| 45 gaim_plugin_pref_add_choice(ppref, "Always", "always"); |
45 gaim_plugin_pref_add_choice(ppref, "Always", "always"); |
| 46 gaim_plugin_pref_frame_add(frame, ppref); |
46 gaim_plugin_pref_frame_add(frame, ppref); |
| 47 |
47 |
| 48 return frame; |
48 return frame; |
| 49 } |
49 } |
| 59 g_return_val_if_fail(tm != NULL, NULL); |
59 g_return_val_if_fail(tm != NULL, NULL); |
| 60 g_return_val_if_fail(dates != NULL, NULL); |
60 g_return_val_if_fail(dates != NULL, NULL); |
| 61 |
61 |
| 62 if (!strcmp(dates, "always") || |
62 if (!strcmp(dates, "always") || |
| 63 (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT && |
63 (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT && |
| 64 !strcmp(dates, "chats"))) |
64 !strcmp(dates, "chats")) || |
| |
65 (time(NULL) > (mktime(tm) + 20*60))) |
| 65 { |
66 { |
| 66 if (force) |
67 if (force) |
| 67 strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm); |
68 strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm); |
| 68 else |
69 else |
| 69 strftime(buf, sizeof(buf), "%x %X", tm); |
70 strftime(buf, sizeof(buf), "%x %X", tm); |