[evolution-patches] patch for bug #69145



http://bugzilla.ximian.com/show_bug.cgi?id=69145

this is a bug that's been sitting in my inbox for a week or 2 now that
I've been wrestling with fixing when I get bored hacking on imap4.

Jeff

-- 
Jeffrey Stedfast
Evolution Hacker - Novell, Inc.
fejj ximian com  - www.novell.com
? 24026.patch
? 62136.patch
? 62771-camel.patch
? 63504.patch
? 65828.patch
? 69145.patch
? body
? body.c
? body.txt
? body2.txt
? build.patch
? charset-map.c
? charset-map.diff
? class.sh
? cmsutil.c
? courier-sucks.patch
? css.c
? date.patch
? diff
? flags
? foo
? foo.txt
? foo2.txt
? getaddrinfo-ex.patch
? gw-body.txt
? iso
? iso.c
? lang.patch
? namespace.sh
? smime
? toplevel-msg-part.patch
? providers/imap4/camel-imap4-stream-test.c
? providers/imap4/reconnect.patch
? tests/data/camel-mime-tests.tar.gz
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/camel/ChangeLog,v
retrieving revision 1.2296
diff -u -r1.2296 ChangeLog
--- ChangeLog	4 Nov 2004 20:52:49 -0000	1.2296
+++ ChangeLog	5 Nov 2004 17:51:15 -0000
@@ -1,3 +1,9 @@
+2004-11-05  Jeffrey Stedfast  <fejj novell com>
+
+	* providers/imap/camel-imap-folder.c (get_content): Changed the
+	logic for when the parent part was a message as well. Fixes bug
+	#69145.
+
 2004-11-04  Jeffrey Stedfast  <fejj novell com>
 
 	* providers/imap4/camel-imap4-engine.c: Added much in-line
Index: providers/imap/camel-imap-folder.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/imap/camel-imap-folder.c,v
retrieving revision 1.338
diff -u -r1.338 camel-imap-folder.c
--- providers/imap/camel-imap-folder.c	20 Sep 2004 05:59:53 -0000	1.338
+++ providers/imap/camel-imap-folder.c	5 Nov 2004 17:51:16 -0000
@@ -1722,7 +1722,8 @@
 {
 	CamelDataWrapper *content = NULL;
 	CamelStream *stream;
-	char *part_spec;
+	char *part_spec, *spec;
+	int ret;
 	
 	part_spec = content_info_get_part_spec (ci);
 
@@ -1731,8 +1732,6 @@
 	/* There are three cases: multipart/signed, multipart, message/rfc822, and "other" */
 	if (camel_content_type_is (ci->type, "multipart", "signed")) {
 		CamelMultipartSigned *body_mp;
-		char *spec;
-		int ret;
 		
 		/* Note: because we get the content parts uninterpreted anyway, we could potentially
 		   just use the normalmultipart code, except that multipart/signed wont let you yet! */
@@ -1788,8 +1787,6 @@
 			sprintf (child_spec + speclen, "%d.MIME", num++);
 			stream = camel_imap_folder_fetch_data (imap_folder, uid, child_spec, FALSE, ex);
 			if (stream) {
-				int ret;
-				
 				part = camel_mime_part_new ();
 				ret = camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (part), stream);
 				camel_object_unref (CAMEL_OBJECT (stream));
@@ -1842,13 +1839,28 @@
 		
 		return (CamelDataWrapper *) body_mp;
 	} else if (camel_content_type_is (ci->type, "message", "rfc822")) {
-		content = (CamelDataWrapper *) get_message (imap_folder, uid, part_spec, ci->childs, ex);
+		CamelMimeMessage *message;
+		
+		if (frommsg) {
+			spec = *part_spec ? part_spec : "1";
+			if (!(stream = camel_imap_folder_fetch_data (imap_folder, uid, spec, FALSE, ex)))
+				return NULL;
+			
+			content = (CamelDataWrapper *) message = camel_mime_message_new ();
+			ret = camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (message), stream);
+			camel_object_unref (stream);
+			if (ret == -1) {
+				camel_object_unref (message);
+				return NULL;
+			}
+		} else {
+			content = (CamelDataWrapper *) get_message (imap_folder, uid, part_spec, ci->childs, ex);
+		}
 		g_free (part_spec);
 		return content;
 	} else {
 		CamelTransferEncoding enc;
-		char *spec;
-
+		
 		spec = g_alloca(strlen(part_spec) + 6);
 		if (frommsg)
 			sprintf(spec, part_spec[0] ? "%s.TEXT" : "1.TEXT", part_spec);

Attachment: smime.p7s
Description: S/MIME cryptographic signature



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