From 5cabf1be00f596a7497d50b3d72bce841bdaed91 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 12 Jun 2003 04:47:32 +0000 Subject: We only really want to use mail_identify_mime_part() if the content-type 2003-06-11 Jeffrey Stedfast * mail-format.c (format_mime_part): We only really want to use mail_identify_mime_part() if the content-type is application/octet-stream - any other type (if it doesn't have a handler) should just force the user to save to disk. (handle_text_plain): Only pay attention to format=flowed if the mime-type is text/plain (handle_text_plain is the generic text handler, so we might be processing parts that are not really text/plain, thus the format param may have different meaning for those other textual types). svn path=/trunk/; revision=21419 --- mail/mail-format.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'mail/mail-format.c') diff --git a/mail/mail-format.c b/mail/mail-format.c index 9b23d9f195..501bf09972 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -494,7 +494,7 @@ mail_lookup_handler (const char *mime_type) goto reg; } - /* If we at least got an application, use that. */ + /* If we at least got an application list, use that. */ if (handler->applications) { handler->generic = TRUE; handler->is_bonobo = FALSE; @@ -724,7 +724,8 @@ format_mime_part (CamelMimePart *part, MailDisplay *md, if (!strcmp (mime_type, "application/mac-binhex40")) { handler = NULL; - } else { + } else if (!strcmp (mime_type, "application/octet-stream")) { + /* only sniff application/octet-stream parts */ id_type = mail_identify_mime_part (part, md); if (id_type) { g_free (mime_type); @@ -1254,9 +1255,12 @@ handle_text_plain (CamelMimePart *part, const char *mime_type, /* Check for RFC 2646 flowed text. */ type = camel_mime_part_get_content_type (part); - format = header_content_type_param (type, "format"); - if (format && !strcasecmp (format, "flowed")) - flags |= CAMEL_MIME_FILTER_TOHTML_FORMAT_FLOWED; + if (header_content_type_is (type, "text", "plain")) { + format = header_content_type_param (type, "format"); + + if (format && !strcasecmp (format, "flowed")) + flags |= CAMEL_MIME_FILTER_TOHTML_FORMAT_FLOWED; + } html_filter = camel_mime_filter_tohtml_new (flags, rgb); filtered_stream = camel_stream_filter_new_with_stream ((CamelStream *) stream); -- cgit