aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer/ChangeLog6
-rw-r--r--composer/e-msg-composer-attachment.c12
2 files changed, 17 insertions, 1 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 3683eebc17..5f3c6a9d6a 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,9 @@
+2002-10-16 Jeffrey Stedfast <fejj@ximian.com>
+
+ * e-msg-composer-attachment.c (e_msg_composer_attachment_new): We
+ need to treat message/rfc822 streams differently. Fixes bug
+ #32378.
+
2002-10-16 Not Zed <NotZed@Ximian.com>
* e-msg-composer-select-file.c (select_file_internal): Mark the
diff --git a/composer/e-msg-composer-attachment.c b/composer/e-msg-composer-attachment.c
index c0f1ef9b47..fa4f62202a 100644
--- a/composer/e-msg-composer-attachment.c
+++ b/composer/e-msg-composer-attachment.c
@@ -189,14 +189,24 @@ e_msg_composer_attachment_new (const char *file_name,
wrapper = camel_data_wrapper_new ();
camel_data_wrapper_construct_from_stream (wrapper, stream);
- camel_object_unref (CAMEL_OBJECT (stream));
+
mime_type = e_msg_composer_guess_mime_type (file_name);
if (mime_type) {
+ if (!strcasecmp (mime_type, "message/rfc822")) {
+ camel_object_unref (wrapper);
+ wrapper = (CamelDataWrapper *) camel_mime_message_new ();
+
+ camel_stream_reset (stream);
+ camel_data_wrapper_construct_from_stream (wrapper, stream);
+ }
+
camel_data_wrapper_set_mime_type (wrapper, mime_type);
g_free (mime_type);
} else
camel_data_wrapper_set_mime_type (wrapper, "application/octet-stream");
+ camel_object_unref (CAMEL_OBJECT (stream));
+
part = camel_mime_part_new ();
camel_medium_set_content_object (CAMEL_MEDIUM (part), wrapper);
camel_object_unref (CAMEL_OBJECT (wrapper));