comparison src/log.c @ 8517:5cb93726e4d5

[gaim-migrate @ 9256] "The problem I noticed with the <AUTO RESPONSE> in plain text logging was that it was logged correctly as plain text but the log reading was not doing html escaping. I also noticed that because all sent text is now marked up in html, things like < > and & were logged as &lt; &gt and &amp; etc. This patch fixes the above problems by improving the markup stripping before writing the log and escaping html while reading the log (only affects plain text logging). I would have posted to sourceforge, but it seems to be having problems at the moment. If I get a chance I'll post it there too." --Stu Tomlinson Nathan, this should fixe the issues you were hitting committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sun, 28 Mar 2004 19:53:43 +0000
parents 13a65fd6a932
children 7dcd6f26e4a7
comparison
equal deleted inserted replaced
8516:5b25f72c4723 8517:5cb93726e4d5
687 return log_lister_common(sn, account, ".txt", &txt_logger); 687 return log_lister_common(sn, account, ".txt", &txt_logger);
688 } 688 }
689 689
690 static char *txt_logger_read(GaimLog *log, GaimLogReadFlags *flags) 690 static char *txt_logger_read(GaimLog *log, GaimLogReadFlags *flags)
691 { 691 {
692 char *read, *minus_header; 692 char *read, *minus_header, *minus_header2;
693 struct generic_logger_data *data = log->logger_data; 693 struct generic_logger_data *data = log->logger_data;
694 *flags = 0; 694 *flags = 0;
695 if (!data || !data->path) 695 if (!data || !data->path)
696 return g_strdup(_("<font color=\"red\"><b>Unable to find log path!</b></font>")); 696 return g_strdup(_("<font color=\"red\"><b>Unable to find log path!</b></font>"));
697 if (g_file_get_contents(data->path, &read, NULL, NULL)) { 697 if (g_file_get_contents(data->path, &read, NULL, NULL)) {
699 if (!minus_header) 699 if (!minus_header)
700 minus_header = g_strdup(read); 700 minus_header = g_strdup(read);
701 else 701 else
702 minus_header = g_strdup(minus_header + 1); 702 minus_header = g_strdup(minus_header + 1);
703 g_free(read); 703 g_free(read);
704 return minus_header; 704 minus_header2 = gaim_escape_html(minus_header);
705 g_free(minus_header);
706 return minus_header2;
705 } 707 }
706 return g_strdup(_("<font color=\"red\"><b>Could not read file: %s</b></font>")); 708 return g_strdup(_("<font color=\"red\"><b>Could not read file: %s</b></font>"));
707 } 709 }
708 710
709 static GaimLogLogger txt_logger = { 711 static GaimLogLogger txt_logger = {