comparison src/conversation.c @ 1735:00f74db70f2d

[gaim-migrate @ 1745] have write_to_conv put on the timestamps for system messages. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 21 Apr 2001 00:32:40 +0000
parents e5ba877f51f2
children 3dfe4aefd366
comparison
equal deleted inserted replaced
1734:dd78a230aa06 1735:00f74db70f2d
1264 1264
1265 /* this is going to be interesting since the conversation could either be a 1265 /* this is going to be interesting since the conversation could either be a
1266 * normal IM conversation or a chat window. but hopefully it won't matter */ 1266 * normal IM conversation or a chat window. but hopefully it won't matter */
1267 void write_to_conv(struct conversation *c, char *what, int flags, char *who) 1267 void write_to_conv(struct conversation *c, char *what, int flags, char *who)
1268 { 1268 {
1269 char *buf = g_malloc(BUF_LONG); 1269 char buf[BUF_LONG];
1270 char *str; 1270 char *str;
1271 FILE *fd; 1271 FILE *fd;
1272 char colour[10]; 1272 char colour[10];
1273 int colorv = -1; 1273 int colorv = -1;
1274 char *clr; 1274 char *clr;
1275 char *smiley = g_malloc(7);
1276 struct buddy *b; 1275 struct buddy *b;
1277 int gtk_font_options = 0; 1276 int gtk_font_options = 0;
1278 GString *logstr; 1277 GString *logstr;
1278 char buf2[BUF_LONG];
1279 1279
1280 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COMMENTS; 1280 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COMMENTS;
1281 1281
1282 if (display_options & OPT_DISP_IGNORE_COLOUR) 1282 if (display_options & OPT_DISP_IGNORE_COLOUR)
1283 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COLOURS; 1283 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COLOURS;
1310 if (b) 1310 if (b)
1311 who = b->show; 1311 who = b->show;
1312 } 1312 }
1313 1313
1314 if (flags & WFLAG_SYSTEM) { 1314 if (flags & WFLAG_SYSTEM) {
1315 1315 if (general_options & OPT_DISP_SHOW_TIME)
1316 gtk_imhtml_append_text(GTK_IMHTML(c->text), what, 0); 1316 g_snprintf(buf, BUF_LONG, "<FONT SIZE=\"2\">(%s) </FONT><B>%s</B>", date(), what);
1317 1317 else
1318 gtk_imhtml_append_text(GTK_IMHTML(c->text), "<BR>", 0); 1318 g_snprintf(buf, BUF_LONG, "<B>%s</B>", date(), what);
1319 g_snprintf(buf2, sizeof(buf2), "<FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B><BR>",
1320 date(), what);
1321
1322 gtk_imhtml_append_text(GTK_IMHTML(c->text), buf2, 0);
1319 1323
1320 if (logging_options & OPT_LOG_STRIP_HTML) { 1324 if (logging_options & OPT_LOG_STRIP_HTML) {
1321 char *t1 = strip_html(what); 1325 char *t1 = strip_html(buf);
1322 c->history = g_string_append(c->history, t1); 1326 c->history = g_string_append(c->history, t1);
1323 c->history = g_string_append(c->history, "\n"); 1327 c->history = g_string_append(c->history, "\n");
1324 g_free(t1); 1328 g_free(t1);
1325 } else { 1329 } else {
1326 c->history = g_string_append(c->history, what); 1330 c->history = g_string_append(c->history, buf);
1327 c->history = g_string_append(c->history, "<BR>\n"); 1331 c->history = g_string_append(c->history, "<BR>\n");
1328 } 1332 }
1329 1333
1330 if ((logging_options & OPT_LOG_ALL) || find_log_info(c->name)) { 1334 if ((logging_options & OPT_LOG_ALL) || find_log_info(c->name)) {
1331 char *t1; 1335 char *t1;
1332 char nm[256]; 1336 char nm[256];
1333 1337
1334 if (logging_options & OPT_LOG_STRIP_HTML) { 1338 if (logging_options & OPT_LOG_STRIP_HTML) {
1335 t1 = strip_html(what); 1339 t1 = strip_html(buf);
1336 } else { 1340 } else {
1337 t1 = what; 1341 t1 = buf;
1338 } 1342 }
1339 if (c->is_chat) 1343 if (c->is_chat)
1340 g_snprintf(nm, 256, "%s.chat", c->name); 1344 g_snprintf(nm, 256, "%s.chat", c->name);
1341 else 1345 else
1342 g_snprintf(nm, 256, "%s", c->name); 1346 g_snprintf(nm, 256, "%s", c->name);
1353 g_free(t1); 1357 g_free(t1);
1354 } 1358 }
1355 } 1359 }
1356 1360
1357 } else { 1361 } else {
1358 char buf2[BUF_LONG];
1359 if ((clr = strstr(what, "<BODY BGCOLOR=\"#")) != NULL) { 1362 if ((clr = strstr(what, "<BODY BGCOLOR=\"#")) != NULL) {
1360 sscanf(clr + strlen("<BODY BGCOLOR=\"#"), "%x", &colorv); 1363 sscanf(clr + strlen("<BODY BGCOLOR=\"#"), "%x", &colorv);
1361 } 1364 }
1362 1365
1363 if (flags & WFLAG_WHISPER) { 1366 if (flags & WFLAG_WHISPER) {
1495 style->fg[0].blue = 0x0000; 1498 style->fg[0].blue = 0x0000;
1496 gtk_widget_set_style(label, style); 1499 gtk_widget_set_style(label, style);
1497 gtk_style_unref(style); 1500 gtk_style_unref(style);
1498 c->unseen = TRUE; 1501 c->unseen = TRUE;
1499 } 1502 }
1500
1501 g_free(smiley);
1502 g_free(buf);
1503 } 1503 }
1504 1504
1505 1505
1506 1506
1507 GtkWidget *build_conv_toolbar(struct conversation *c) 1507 GtkWidget *build_conv_toolbar(struct conversation *c)