From cd7969810436f5f4074736e72e6f68fac9469074 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Thu, 29 Jan 2004 09:45:59 +0000 Subject: Fixes a bug i can't find right now 2004-01-29 Not Zed * em-format-html-display.c (efhd_attachment_button): check the snooped type for the icon/etc. (efhd_format_attachment): save the snooped type in the attach_puri. * em-format-html.c (efh_text_plain): If we had a snooped type, use that as the base type, rather than octet-stream, which will cause an attachment in attachment loop. * em-format.c (em_format_part_as): save the current snooped mime type in a stack if we had any. svn path=/trunk/; revision=24515 --- mail/em-format.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mail/em-format.c') diff --git a/mail/em-format.c b/mail/em-format.c index ef6678dfb3..7eb8794827 100644 --- a/mail/em-format.c +++ b/mail/em-format.c @@ -477,10 +477,13 @@ void em_format_part_as(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const char *mime_type) { const EMFormatHandler *handle = NULL; + const char *snoop_save = emf->snoop_mime_type; + + emf->snoop_mime_type = NULL; if (mime_type != NULL) { if (g_ascii_strcasecmp(mime_type, "application/octet-stream") == 0) - mime_type = emf_snoop_part(part); + emf->snoop_mime_type = mime_type = emf_snoop_part(part); handle = em_format_find_handler(emf, mime_type); if (handle == NULL) @@ -490,6 +493,7 @@ em_format_part_as(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const && !em_format_is_attachment(emf, part)) { d(printf("running handler for type '%s'\n", mime_type)); handle->handler(emf, stream, part, handle); + emf->snoop_mime_type = snoop_save; return; } d(printf("this type is an attachment? '%s'\n", mime_type)); @@ -498,6 +502,7 @@ em_format_part_as(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const } ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->format_attachment(emf, stream, part, mime_type, handle); + emf->snoop_mime_type = snoop_save; } void -- cgit