aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/mail-format.c19
-rw-r--r--mail/mail-tools.c1
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 <fejj@ximian.com>
+
+ * mail-format.c (mail_get_message_body): Fix to not always return
+ NULL for html parts, doh!.
+
2001-10-24 <NotZed@Ximian.com>
* 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 = "<br>\n----<br>\n<br>\n";
} else
div = "<br><hr><br>";
-
+
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