From a4a43fe1fc888b7bdd4f665157f1d7911434b660 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 16 Dec 2002 20:11:36 +0000 Subject: Use camel_text_to_html() instead of e_text_to_html(). (mail_text_write): 2002-12-16 Jeffrey Stedfast * mail-display.c (mail_error_printf): Use camel_text_to_html() instead of e_text_to_html(). (mail_text_write): Write the content directly to gtkhtml through an html stream filter. * mail-format.c (attachment_header): Use camel_text_to_html() instead of e_text_to_html(). (write_text_header): Same. (write_address): Here too. (mail_get_message_rfc822): And here. (mail_get_message_body): And finally here. svn path=/trunk/; revision=19133 --- mail/mail-format.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'mail/mail-format.c') diff --git a/mail/mail-format.c b/mail/mail-format.c index 7c71d293b1..7b7eabd2ee 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -44,7 +44,6 @@ #include #include -#include #include "mail.h" #include "mail-tools.h" @@ -630,14 +629,14 @@ attachment_header (CamelMimePart *part, const char *mime_type, MailDisplay *md, /* Write the MIME type */ info = gnome_vfs_mime_get_description (mime_type); - htmlinfo = e_text_to_html (info ? info : mime_type, 0); + htmlinfo = camel_text_to_html (info ? info : mime_type, 0, 0); camel_stream_printf ((CamelStream *) stream, _("%s attachment"), htmlinfo); g_free (htmlinfo); /* Write the name, if we have it. */ info = camel_mime_part_get_filename (part); if (info) { - htmlinfo = e_text_to_html (info, 0); + htmlinfo = camel_text_to_html (info, 0, 0); camel_stream_printf ((CamelStream *) stream, " (%s)", htmlinfo); g_free (htmlinfo); } @@ -645,7 +644,7 @@ attachment_header (CamelMimePart *part, const char *mime_type, MailDisplay *md, /* Write a description, if we have one. */ info = camel_mime_part_get_description (part); if (info) { - htmlinfo = e_text_to_html (info, md->printing ? 0 : E_TEXT_TO_HTML_CONVERT_URLS); + htmlinfo = camel_text_to_html (info, md->printing ? 0 : CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, 0); camel_stream_printf ((CamelStream *) stream, ", \"%s\"", htmlinfo); g_free (htmlinfo); } @@ -762,7 +761,7 @@ write_text_header (MailDisplayStream *stream, const char *name, const char *valu char *encoded; if (value && *value) - encoded = e_text_to_html (value, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS); + encoded = camel_text_to_html (value, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL | CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, 0); else encoded = ""; @@ -802,11 +801,11 @@ write_address (MailDisplay *md, MailDisplayStream *stream, camel_object_unref (subaddr); if (have_name) { - name_disp = e_text_to_html (name, 0); + name_disp = camel_text_to_html (name, 0, 0); } if (have_email) { - email_disp = e_text_to_html (email, 0); + email_disp = camel_text_to_html (email, 0, 0); } if (i) @@ -1873,7 +1872,7 @@ mail_get_message_rfc822 (CamelMimeMessage *message, gboolean want_plain, gboolea cia = camel_mime_message_get_from (message); buf = camel_address_format (CAMEL_ADDRESS (cia)); if (buf) { - html = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL); + html = camel_text_to_html (buf, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0); g_string_sprintfa (retval, "%sFrom: %s
", citation, html); g_free (html); @@ -1883,7 +1882,7 @@ mail_get_message_rfc822 (CamelMimeMessage *message, gboolean want_plain, gboolea cia = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO); buf = camel_address_format (CAMEL_ADDRESS (cia)); if (buf) { - html = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL); + html = camel_text_to_html (buf, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0); g_string_sprintfa (retval, "%sTo: %s
", citation, html); g_free (html); @@ -1893,7 +1892,7 @@ mail_get_message_rfc822 (CamelMimeMessage *message, gboolean want_plain, gboolea cia = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_CC); buf = camel_address_format (CAMEL_ADDRESS (cia)); if (buf) { - html = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL); + html = camel_text_to_html (buf, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0); g_string_sprintfa (retval, "%sCc: %s
", citation, html); g_free (html); @@ -1902,7 +1901,8 @@ mail_get_message_rfc822 (CamelMimeMessage *message, gboolean want_plain, gboolea buf = (char *) camel_mime_message_get_subject (message); if (buf) { - html = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS); + html = camel_text_to_html (buf, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL | + CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, 0); g_string_sprintfa (retval, "%sSubject: %s
", citation, html); g_free (html); @@ -1910,7 +1910,7 @@ mail_get_message_rfc822 (CamelMimeMessage *message, gboolean want_plain, gboolea date_val = camel_mime_message_get_date (message, &offset); buf = header_format_date (date_val, offset); - html = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL); + html = camel_text_to_html (buf, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0); g_string_sprintfa (retval, "%sDate: %s
", citation, html); g_free (html); g_free (buf); @@ -1982,8 +1982,9 @@ mail_get_message_body (CamelDataWrapper *data, gboolean want_plain, gboolean cit if (text && !header_content_type_is (mime_type, "text", "html")) { char *html; - html = e_text_to_html (text, E_TEXT_TO_HTML_PRE | E_TEXT_TO_HTML_CONVERT_URLS | - (cite ? E_TEXT_TO_HTML_CITE : 0)); + html = camel_text_to_html (text, CAMEL_MIME_FILTER_TOHTML_PRE | + CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | + (cite ? CAMEL_MIME_FILTER_TOHTML_CITE : 0), 0); g_free (text); text = html; } -- cgit v1.2.3