comparison src/conversation.c @ 1764:1e0613d9526b

[gaim-migrate @ 1774] I decided to do the time stamp w/ messages thing that Eric put in the TODO list. committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Fri, 27 Apr 2001 23:26:19 +0000
parents e0f936b4c91a
children 896432d66303
comparison
equal deleted inserted replaced
1763:5ad0b0c3ea01 1764:1e0613d9526b
826 g_free(buffy); 826 g_free(buffy);
827 } 827 }
828 828
829 if (!c->is_chat) { 829 if (!c->is_chat) {
830 buf3 = g_strdup(buf); 830 buf3 = g_strdup(buf);
831 write_to_conv(c, buf3, WFLAG_SEND, NULL); 831 write_to_conv(c, buf3, WFLAG_SEND, NULL, time((time_t)NULL));
832 g_free(buf3); 832 g_free(buf3);
833 833
834 serv_send_im(c->gc, c->name, buf, 0); 834 serv_send_im(c->gc, c->name, buf, 0);
835 835
836 if (c->makesound && (sound_options & OPT_SOUND_SEND)) 836 if (c->makesound && (sound_options & OPT_SOUND_SEND))
1264 /*------------------------------------------------------------------------*/ 1264 /*------------------------------------------------------------------------*/
1265 1265
1266 1266
1267 /* this is going to be interesting since the conversation could either be a 1267 /* this is going to be interesting since the conversation could either be a
1268 * normal IM conversation or a chat window. but hopefully it won't matter */ 1268 * normal IM conversation or a chat window. but hopefully it won't matter */
1269 void write_to_conv(struct conversation *c, char *what, int flags, char *who) 1269 void write_to_conv(struct conversation *c, char *what, int flags, char *who, time_t mtime)
1270 { 1270 {
1271 char buf[BUF_LONG]; 1271 char buf[BUF_LONG];
1272 char *str; 1272 char *str;
1273 FILE *fd; 1273 FILE *fd;
1274 char colour[10]; 1274 char colour[10];
1276 char *clr; 1276 char *clr;
1277 struct buddy *b; 1277 struct buddy *b;
1278 int gtk_font_options = 0; 1278 int gtk_font_options = 0;
1279 GString *logstr; 1279 GString *logstr;
1280 char buf2[BUF_LONG]; 1280 char buf2[BUF_LONG];
1281 char mdate[64];
1282
1283 strftime(mdate, sizeof(mdate), "%H:%M:%S", localtime(&mtime));
1281 1284
1282 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COMMENTS; 1285 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COMMENTS;
1283 1286
1284 if (display_options & OPT_DISP_IGNORE_COLOUR) 1287 if (display_options & OPT_DISP_IGNORE_COLOUR)
1285 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COLOURS; 1288 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COLOURS;
1311 b = find_buddy(c->gc, who); 1314 b = find_buddy(c->gc, who);
1312 if (b) 1315 if (b)
1313 who = b->show; 1316 who = b->show;
1314 } 1317 }
1315 1318
1319
1316 if (flags & WFLAG_SYSTEM) { 1320 if (flags & WFLAG_SYSTEM) {
1317 if (general_options & OPT_DISP_SHOW_TIME) 1321 if (general_options & OPT_DISP_SHOW_TIME)
1318 g_snprintf(buf, BUF_LONG, "<FONT SIZE=\"2\">(%s) </FONT><B>%s</B>", date(), what); 1322 g_snprintf(buf, BUF_LONG, "<FONT SIZE=\"2\">(%s) </FONT><B>%s</B>", mdate, what);
1319 else 1323 else
1320 g_snprintf(buf, BUF_LONG, "<B>%s</B>", date(), what); 1324 g_snprintf(buf, BUF_LONG, "<B>%s</B>", mdate, what);
1321 g_snprintf(buf2, sizeof(buf2), "<FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B><BR>", 1325 g_snprintf(buf2, sizeof(buf2), "<FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B><BR>",
1322 date(), what); 1326 mdate, what);
1323 1327
1324 gtk_imhtml_append_text(GTK_IMHTML(c->text), buf2, 0); 1328 gtk_imhtml_append_text(GTK_IMHTML(c->text), buf2, 0);
1325 1329
1326 if (logging_options & OPT_LOG_STRIP_HTML) { 1330 if (logging_options & OPT_LOG_STRIP_HTML) {
1327 char *t1 = strip_html(buf); 1331 char *t1 = strip_html(buf);
1397 } 1401 }
1398 } 1402 }
1399 1403
1400 if (general_options & OPT_DISP_SHOW_TIME) 1404 if (general_options & OPT_DISP_SHOW_TIME)
1401 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\">(%s) </FONT>" 1405 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\">(%s) </FONT>"
1402 "<B>%s</B></FONT> ", colour, date(), str); 1406 "<B>%s</B></FONT> ", colour, mdate, str);
1403 else 1407 else
1404 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><B>%s</B></FONT> ", colour, str); 1408 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><B>%s</B></FONT> ", colour, str);
1405 g_snprintf(buf2, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\"><!--(%s) --></FONT>" 1409 g_snprintf(buf2, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\"><!--(%s) --></FONT>"
1406 "<B>%s</B></FONT> ", colour, date(), str); 1410 "<B>%s</B></FONT> ", colour, mdate, str);
1407 1411
1408 g_free(str); 1412 g_free(str);
1409 1413
1410 gtk_imhtml_append_text(GTK_IMHTML(c->text), buf2, 0); 1414 gtk_imhtml_append_text(GTK_IMHTML(c->text), buf2, 0);
1411 1415