From e877791d816307b359d73732345f0e2164c49f4a Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 25 Oct 2001 00:51:10 +0000 Subject: Fix to not always return NULL for html parts, doh!. 2001-10-24 Jeffrey Stedfast * mail-format.c (mail_get_message_body): Fix to not always return NULL for html parts, doh!. svn path=/trunk/; revision=14081 --- mail/ChangeLog | 5 +++++ mail/mail-format.c | 19 +++++++++---------- mail/mail-tools.c | 1 + 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index cb019d7ef8..b4bcdd7b86 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,8 @@ +2001-10-24 Jeffrey Stedfast + + * mail-format.c (mail_get_message_body): Fix to not always return + NULL for html parts, doh!. + 2001-10-24 * folder-browser-ui.c (ui_add): diff --git a/mail/mail-format.c b/mail/mail-format.c index 1cb517d291..9b9dffb4fa 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -2245,11 +2245,10 @@ char * mail_get_message_body (CamelDataWrapper *data, gboolean want_plain, gboolean cite) { CamelContentType *mime_type; - CamelMultipart *mp; + char *subtext, *old, *div, *text = NULL; + GByteArray *bytes = NULL; CamelMimePart *subpart; - char *subtext, *old, *div; - char *text = NULL; - GByteArray *bytes; + CamelMultipart *mp; int i, nparts; mime_type = camel_data_wrapper_get_mime_type_field (data); @@ -2270,13 +2269,13 @@ mail_get_message_body (CamelDataWrapper *data, gboolean want_plain, gboolean cit if (header_content_type_is (mime_type, "text", "*") || header_content_type_is (mime_type, "message", "*")) { bytes = mail_format_get_data_wrapper_text (data, NULL); - if (bytes && !header_content_type_is (mime_type, "text", "html")) { + g_byte_array_append (bytes, "", 1); + text = bytes->data; + g_byte_array_free (bytes, FALSE); + + if (text && !header_content_type_is (mime_type, "text", "html")) { char *html; - g_byte_array_append (bytes, "", 1); - text = bytes->data; - g_byte_array_free (bytes, FALSE); - html = e_text_to_html (text, E_TEXT_TO_HTML_PRE | (cite ? E_TEXT_TO_HTML_CITE : 0)); g_free (text); text = html; @@ -2311,7 +2310,7 @@ mail_get_message_body (CamelDataWrapper *data, gboolean want_plain, gboolean cit div = "
\n----
\n
\n"; } else div = "


"; - + nparts = camel_multipart_get_number (mp); for (i = 0; i < nparts; i++) { subpart = camel_multipart_get_part (mp, i); diff --git a/mail/mail-tools.c b/mail/mail-tools.c index 383060d2b8..82327dfcb0 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -368,6 +368,7 @@ mail_tool_quote_message (CamelMimeMessage *message, const char *fmt, ...) return NULL; } + /** * mail_tool_forward_message: * @message: mime message to forward -- cgit v1.2.3