Mercurial > pidgin
diff 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 |
line wrap: on
line diff
--- a/src/conversation.c Fri Apr 27 22:21:53 2001 +0000 +++ b/src/conversation.c Fri Apr 27 23:26:19 2001 +0000 @@ -828,7 +828,7 @@ if (!c->is_chat) { buf3 = g_strdup(buf); - write_to_conv(c, buf3, WFLAG_SEND, NULL); + write_to_conv(c, buf3, WFLAG_SEND, NULL, time((time_t)NULL)); g_free(buf3); serv_send_im(c->gc, c->name, buf, 0); @@ -1266,7 +1266,7 @@ /* this is going to be interesting since the conversation could either be a * normal IM conversation or a chat window. but hopefully it won't matter */ -void write_to_conv(struct conversation *c, char *what, int flags, char *who) +void write_to_conv(struct conversation *c, char *what, int flags, char *who, time_t mtime) { char buf[BUF_LONG]; char *str; @@ -1278,6 +1278,9 @@ int gtk_font_options = 0; GString *logstr; char buf2[BUF_LONG]; + char mdate[64]; + + strftime(mdate, sizeof(mdate), "%H:%M:%S", localtime(&mtime)); gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COMMENTS; @@ -1313,13 +1316,14 @@ who = b->show; } + if (flags & WFLAG_SYSTEM) { if (general_options & OPT_DISP_SHOW_TIME) - g_snprintf(buf, BUF_LONG, "<FONT SIZE=\"2\">(%s) </FONT><B>%s</B>", date(), what); + g_snprintf(buf, BUF_LONG, "<FONT SIZE=\"2\">(%s) </FONT><B>%s</B>", mdate, what); else - g_snprintf(buf, BUF_LONG, "<B>%s</B>", date(), what); + g_snprintf(buf, BUF_LONG, "<B>%s</B>", mdate, what); g_snprintf(buf2, sizeof(buf2), "<FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B><BR>", - date(), what); + mdate, what); gtk_imhtml_append_text(GTK_IMHTML(c->text), buf2, 0); @@ -1399,11 +1403,11 @@ if (general_options & OPT_DISP_SHOW_TIME) g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\">(%s) </FONT>" - "<B>%s</B></FONT> ", colour, date(), str); + "<B>%s</B></FONT> ", colour, mdate, str); else g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><B>%s</B></FONT> ", colour, str); g_snprintf(buf2, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\"><!--(%s) --></FONT>" - "<B>%s</B></FONT> ", colour, date(), str); + "<B>%s</B></FONT> ", colour, mdate, str); g_free(str);