plugins/timestamp.c

changeset 4359
cf899ee07d1d
parent 4220
37fb7ec45980
child 4376
88f8faf7cb61
equal deleted inserted replaced
4358:a6fc799d5c40 4359:cf899ee07d1d
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
98 } 98 }
99 99
100 100
101 char *gaim_plugin_init(GModule *h) { 101 char *gaim_plugin_init(GModule *h) {
102 GList *cnvs = conversations; 102 GList *cnvs = conversations;
103 struct conversation *c; 103 struct gaim_conversation *c;
104 handle = h; 104 handle = h;
105 105
106 while (cnvs) { 106 while (cnvs) {
107 c = cnvs->data; 107 c = cnvs->data;
108 timestamp_new_convo(c->name); 108 timestamp_new_convo(c->name);

mercurial