evolution-data-server r9654 - in branches/EXCHANGE_MAPI_BRANCH: camel/providers/mapi servers/mapi



Author: jjohnny
Date: Wed Oct  8 04:56:20 2008
New Revision: 9654
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9654&view=rev

Log:
Not fetching PR_BODY_HTML_UNICODE. Seems to corrupt data. Fixes - No body in email messages - issue.

Modified:
   branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/ChangeLog
   branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-folder.c
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/ChangeLog
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.c

Modified: branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-folder.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-folder.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-folder.c	Wed Oct  8 04:56:20 2008
@@ -599,6 +599,10 @@
 
 	PR_BODY, 
 	PR_BODY_UNICODE, 
+	PR_HTML,
+	/*Fixme : If this property is fetched, it garbles everything else. */
+ 	/*PR_BODY_HTML, */
+ 	/*PR_BODY_HTML_UNICODE, */
 
 	PR_DISPLAY_TO, 
 	PR_DISPLAY_TO_UNICODE, 
@@ -760,9 +764,9 @@
 
 		item->is_cal = TRUE;
 	} else { 
-		if (!((body = exchange_mapi_util_find_stream (streams, PR_BODY_HTML)) || 
-		      (body = exchange_mapi_util_find_stream (streams, PR_HTML))))
-			body = exchange_mapi_util_find_stream (streams, PR_BODY);
+		if (!((body = exchange_mapi_util_find_stream (streams, PR_HTML)) || 
+		      (body = exchange_mapi_util_find_stream (streams, PR_BODY))))
+			body = exchange_mapi_util_find_stream (streams, PR_BODY_UNICODE);
 
 		item->msg.body_parts = g_slist_append (item->msg.body_parts, body);
 
@@ -883,6 +887,7 @@
 		else {
 			type = (body->proptag == PR_BODY || body->proptag == PR_BODY_UNICODE) ? 
 				"text/plain" : "text/html";
+
 			camel_mime_part_set_content(part, body->value->data, body->value->len, type );
 		}
 	} else
@@ -944,10 +949,6 @@
 
 			stream = exchange_mapi_util_find_stream (attach->streams, PR_ATTACH_DATA_BIN);
 
-			printf("%s(%d):%s:Attachment --\n\tFileName : %s \n\tMIME Tag : %s\n\tLength : %d\n",
-			       __FILE__, __LINE__, __PRETTY_FUNCTION__, 
-				 filename, mime_type, stream ? stream->value->len : 0);
-
 			if (!stream || stream->value->len <= 0) {
 				continue;
 			}
@@ -1047,7 +1048,7 @@
 	MapiItem *item = NULL;
 	guint32 options = 0;
 
-	options = MAPI_OPTIONS_FETCH_ALL | MAPI_OPTIONS_GETBESTBODY ;
+	options = MAPI_OPTIONS_FETCH_ALL | MAPI_OPTIONS_FETCH_BODY_STREAM | MAPI_OPTIONS_GETBESTBODY ;
 	exchange_mapi_util_mapi_ids_from_uid (uid, &id_folder, &id_message);
 
 	if (((CamelMapiFolder *)folder)->type == MAPI_FAVOURITE_FOLDER){

Modified: branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.c	Wed Oct  8 04:56:20 2008
@@ -259,12 +259,10 @@
 	mem_ctx = talloc_init ("ExchangeMAPI_ReadBodyStream");
 
 	/* Build the array of properties we want to fetch */
-	SPropTagArray = set_SPropTagArray(mem_ctx, 0x8,
+	SPropTagArray = set_SPropTagArray(mem_ctx, 0x6,
 					  PR_MSG_EDITOR_FORMAT,
 					  PR_BODY,
 					  PR_BODY_UNICODE,
-					  PR_BODY_HTML, 
-					  PR_BODY_HTML_UNICODE, 
 					  PR_HTML,
 					  PR_RTF_COMPRESSED,
 					  PR_RTF_IN_SYNC);
@@ -315,10 +313,12 @@
 			} 
 			break;
 		case olEditorHTML: 
-			if ((data = (const char *) get_SPropValue (lpProps, PR_BODY_HTML_UNICODE)) != NULL)
-				proptag = PR_BODY_HTML_UNICODE;
-			else if ((data = (const char *) get_SPropValue (lpProps, PR_BODY_HTML)) != NULL)
+			/* Fixme : */
+ 			/*if ((data = (const char *) get_SPropValue (lpProps, PR_BODY_HTML_UNICODE)) != NULL) */
+ 			/*	proptag = PR_BODY_HTML_UNICODE; */
+			if ((data = (const char *) get_SPropValue (lpProps, PR_BODY_HTML)) != NULL)
 				proptag = PR_BODY_HTML;
+
 			if (data) {
 				size_t size = strlen(data)+1;
 				body.data = talloc_memdup(mem_ctx, data, size);



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