| 19 GModule *handle; |
19 GModule *handle; |
| 20 GSList *timestamp_timeouts; |
20 GSList *timestamp_timeouts; |
| 21 |
21 |
| 22 gboolean do_timestamp (gpointer data) |
22 gboolean do_timestamp (gpointer data) |
| 23 { |
23 { |
| 24 struct conversation *c = data; |
24 struct gaim_conversation *c = (struct gaim_conversation *)data; |
| 25 char *buf; |
25 char *buf; |
| 26 char mdate[6]; |
26 char mdate[6]; |
| 27 time_t tim = time(NULL); |
27 time_t tim = time(NULL); |
| 28 |
28 |
| 29 if (!g_list_find(conversations, c)) |
29 if (!g_list_find(conversations, c)) |
| 30 return FALSE; |
30 return FALSE; |
| 31 |
31 |
| 32 strftime(mdate, sizeof(mdate), "%H:%M", localtime(&tim)); |
32 strftime(mdate, sizeof(mdate), "%H:%M", localtime(&tim)); |
| 33 buf = g_strdup_printf(" %s", mdate); |
33 buf = g_strdup_printf(" %s", mdate); |
| 34 write_to_conv(c, buf, WFLAG_NOLOG, NULL, tim, -1); |
34 gaim_conversation_write(c, NULL, buf, WFLAG_NOLOG, tim, -1); |
| 35 g_free(buf); |
35 g_free(buf); |
| 36 return TRUE; |
36 return TRUE; |
| 37 } |
37 } |
| 38 |
38 |
| 39 void timestamp_new_convo(char *name) |
39 void timestamp_new_convo(char *name) |
| 40 { |
40 { |
| 41 struct conversation *c = find_conversation(name); |
41 struct gaim_conversation *c = gaim_find_conversation(name); |
| 42 do_timestamp(c); |
42 do_timestamp(c); |
| 43 |
43 |
| 44 timestamp_timeouts = g_slist_append(timestamp_timeouts, |
44 timestamp_timeouts = g_slist_append(timestamp_timeouts, |
| 45 GINT_TO_POINTER(g_timeout_add(timestamp, do_timestamp, c))); |
45 GINT_TO_POINTER(g_timeout_add(timestamp, do_timestamp, c))); |
| 46 |
46 |