From c1488e33dad8e49826a30e056282926f15f13537 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sat, 10 Feb 2001 09:14:38 +0000 Subject: multipart/* is another mime type we DO NOT want to encode ;-) 2001-02-10 Jeffrey Stedfast * e-msg-composer-attachment-bar.c (attach_to_multipart): multipart/* is another mime type we DO NOT want to encode ;-) svn path=/trunk/; revision=8156 --- composer/ChangeLog | 5 ++++ composer/e-msg-composer-attachment-bar.c | 42 +++++++++++++++++--------------- 2 files changed, 27 insertions(+), 20 deletions(-) (limited to 'composer') diff --git a/composer/ChangeLog b/composer/ChangeLog index 2d8f902b48..4704e382d7 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,8 @@ +2001-02-10 Jeffrey Stedfast + + * e-msg-composer-attachment-bar.c (attach_to_multipart): + multipart/* is another mime type we DO NOT want to encode ;-) + 2001-02-06 Christopher James Lahey * e-msg-composer-hdrs.c (address_button_clicked_cb, add_header): diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c index d797f4aa4e..9c125e08b8 100644 --- a/composer/e-msg-composer-attachment-bar.c +++ b/composer/e-msg-composer-attachment-bar.c @@ -718,26 +718,28 @@ attach_to_multipart (CamelMultipart *multipart, content_type = camel_mime_part_get_content_type (attachment->body); - if (header_content_type_is (content_type, "text", "*")) { - CamelStream *stream; - GByteArray *array; - guchar *text; - - array = g_byte_array_new (); - stream = camel_stream_mem_new_with_byte_array (array); - camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (attachment->body), stream); - g_byte_array_append (array, "", 1); - text = array->data; - - if (is_8bit (text)) - camel_mime_part_set_encoding (attachment->body, best_encoding (text)); - else - camel_mime_part_set_encoding (attachment->body, CAMEL_MIME_PART_ENCODING_7BIT); - - camel_object_unref (CAMEL_OBJECT (stream)); - } else if (!header_content_type_is (content_type, "message", "*")) { - camel_mime_part_set_encoding (attachment->body, - CAMEL_MIME_PART_ENCODING_BASE64); + if (!header_content_type_is (content_type, "multipart", "*")) { + if (header_content_type_is (content_type, "text", "*")) { + CamelStream *stream; + GByteArray *array; + guchar *text; + + array = g_byte_array_new (); + stream = camel_stream_mem_new_with_byte_array (array); + camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (attachment->body), stream); + g_byte_array_append (array, "", 1); + text = array->data; + + if (is_8bit (text)) + camel_mime_part_set_encoding (attachment->body, best_encoding (text)); + else + camel_mime_part_set_encoding (attachment->body, CAMEL_MIME_PART_ENCODING_7BIT); + + camel_object_unref (CAMEL_OBJECT (stream)); + } else if (!header_content_type_is (content_type, "message", "*")) { + camel_mime_part_set_encoding (attachment->body, + CAMEL_MIME_PART_ENCODING_BASE64); + } } camel_multipart_add_part (multipart, attachment->body); -- cgit v1.2.3