[evolution/webkit: 112/124] Parse too big emails as attachments



commit 74c7e3f8eecd87de848dc3e2a4191a2cb9f497e4
Author: Dan VrÃtil <dvratil redhat com>
Date:   Mon Jan 9 15:02:36 2012 +0100

    Parse too big emails as attachments

 em-format/em-format.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/em-format/em-format.c b/em-format/em-format.c
index 9f166dd..dddd551 100644
--- a/em-format/em-format.c
+++ b/em-format/em-format.c
@@ -367,7 +367,6 @@ emf_parse_multipart_alternative (EMFormat *emf,
 		CamelStream *null_stream;
 		gchar *mime_type;
 		gsize content_size;
-		 GByteArray *ba;
 
 		if (g_cancellable_is_cancelled (cancellable))
 			return;
@@ -2176,7 +2175,18 @@ em_format_format_text (EMFormat *emf,
 			mem_stream, (CamelStream *) stream, cancellable, NULL);
 		camel_stream_flush ((CamelStream *) mem_stream, cancellable, NULL);
 	} else {
-		/* FIXME WEBKIT */
+		/* Parse it as an attachment */
+		CamelMimePart *part = camel_mime_part_new ();
+		EMFormatParserInfo info = { 0 };
+		GString *part_id = g_string_new (".attachment");
+		camel_medium_set_content ((CamelMedium *) part, dw);
+
+		info.is_attachment = TRUE;
+		em_format_parse_part_as (emf, part, part_id, &info,
+			"x-evolution/message/attachment", cancellable);
+
+		g_string_free (part_id, TRUE);
+		g_object_unref (part);
 	}
 
 	if (windows)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]