| 501 ****************************/ |
501 ****************************/ |
| 502 |
502 |
| 503 static void html_logger_write(GaimLog *log, GaimMessageFlags type, |
503 static void html_logger_write(GaimLog *log, GaimMessageFlags type, |
| 504 const char *from, time_t time, const char *message) |
504 const char *from, time_t time, const char *message) |
| 505 { |
505 { |
| 506 GaimConnection *gc = gaim_account_get_connection(log->account); |
|
| 507 char date[64]; |
506 char date[64]; |
| 508 char *msg_fixed; |
507 char *msg_fixed; |
| 509 struct generic_logger_data *data = log->logger_data; |
508 struct generic_logger_data *data = log->logger_data; |
| |
509 GaimPlugin *plugin = gaim_find_prpl(gaim_account_get_protocol_id(log->account)); |
| |
510 const char *prpl_name = plugin->info->name; |
| |
511 |
| 510 if(!data) { |
512 if(!data) { |
| 511 /* This log is new */ |
513 /* This log is new */ |
| 512 char *ud = gaim_user_dir(); |
514 char *ud = gaim_user_dir(); |
| 513 char *guy = g_strdup(gaim_normalize(log->account, gaim_account_get_username(log->account))); |
515 char *guy = g_strdup(gaim_normalize(log->account, gaim_account_get_username(log->account))); |
| 514 char *chat; |
516 char *chat; |
| 515 const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO |
517 const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO(plugin)->list_icon(log->account, NULL); |
| 516 (gaim_find_prpl(gaim_account_get_protocol_id(log->account)))->list_icon(log->account, NULL); |
|
| 517 char *dir; |
518 char *dir; |
| 518 char *filename; |
519 char *filename; |
| 519 |
520 |
| 520 if (log->type == GAIM_LOG_CHAT) { |
521 if (log->type == GAIM_LOG_CHAT) { |
| 521 chat = g_strdup_printf("%s.chat", guy); |
522 chat = g_strdup_printf("%s.chat", guy); |
| 575 else if (type & GAIM_MESSAGE_RECV) |
576 else if (type & GAIM_MESSAGE_RECV) |
| 576 fprintf(data->file, _("<font color=\"#A82F2F\"><font size=\"2\">(%s)</font> <b>%s <AUTO-REPLY>:</b></font> %s<br/>\n"), date, from, msg_fixed); |
577 fprintf(data->file, _("<font color=\"#A82F2F\"><font size=\"2\">(%s)</font> <b>%s <AUTO-REPLY>:</b></font> %s<br/>\n"), date, from, msg_fixed); |
| 577 } else if (type & GAIM_MESSAGE_RECV) { |
578 } else if (type & GAIM_MESSAGE_RECV) { |
| 578 if(gaim_message_meify(msg_fixed, -1)) |
579 if(gaim_message_meify(msg_fixed, -1)) |
| 579 fprintf(data->file, "<font color=\"#6C2585\"><font size=\"2\">(%s)</font> <b>***%s</b></font> <font sml=\"%s\">%s</font><br/>\n", |
580 fprintf(data->file, "<font color=\"#6C2585\"><font size=\"2\">(%s)</font> <b>***%s</b></font> <font sml=\"%s\">%s</font><br/>\n", |
| 580 date, from, gc->prpl->info->name, msg_fixed); |
581 date, from, prpl_name, msg_fixed); |
| 581 else |
582 else |
| 582 fprintf(data->file, "<font color=\"#A82F2F\"><font size=\"2\">(%s)</font> <b>%s:</b></font> <font sml=\"%s\">%s</font><br/>\n", |
583 fprintf(data->file, "<font color=\"#A82F2F\"><font size=\"2\">(%s)</font> <b>%s:</b></font> <font sml=\"%s\">%s</font><br/>\n", |
| 583 date, from, gc->prpl->info->name, msg_fixed); |
584 date, from, prpl_name, msg_fixed); |
| 584 } else if (type & GAIM_MESSAGE_SEND) { |
585 } else if (type & GAIM_MESSAGE_SEND) { |
| 585 if(gaim_message_meify(msg_fixed, -1)) |
586 if(gaim_message_meify(msg_fixed, -1)) |
| 586 fprintf(data->file, "<font color=\"#6C2585\"><font size=\"2\">(%s)</font> <b>***%s</b></font> <font sml=\"%s\">%s</font><br/>\n", |
587 fprintf(data->file, "<font color=\"#6C2585\"><font size=\"2\">(%s)</font> <b>***%s</b></font> <font sml=\"%s\">%s</font><br/>\n", |
| 587 date, from, gc->prpl->info->name, msg_fixed); |
588 date, from, prpl_name, msg_fixed); |
| 588 else |
589 else |
| 589 fprintf(data->file, "<font color=\"#16569E\"><font size=\"2\">(%s)</font> <b>%s:</b></font> <font sml=\"%s\">%s</font><br/>\n", |
590 fprintf(data->file, "<font color=\"#16569E\"><font size=\"2\">(%s)</font> <b>%s:</b></font> <font sml=\"%s\">%s</font><br/>\n", |
| 590 date, from, gc->prpl->info->name, msg_fixed); |
591 date, from, prpl_name, msg_fixed); |
| 591 } |
592 } |
| 592 } |
593 } |
| 593 |
594 |
| 594 g_free(msg_fixed); |
595 g_free(msg_fixed); |
| 595 fflush(data->file); |
596 fflush(data->file); |