From 3e652b2f50c9e7757904076c731f72beaf677c5e Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sun, 13 Feb 2011 21:53:04 +0000 Subject: [PATCH] Monotone-Parent: 2d84c830169d9e6fc80c66cebbaee3d4903fdb88 Monotone-Revision: 44e710d477fe4c00e417c926d9eecec7dd1a12c1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-02-13T21:53:04 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 9 +++++++++ OpenChange/MAPIStoreMailMessageTable.m | 12 +++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 921597a75..2dc5c6932 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-02-13 Wolfgang Sourdeau + + * OpenChange/MAPIStoreMailMessageTable.m + (-getChildProperty:forKey:withTag:): enhanced treatment of + PR_BODY_UNICODE to accept text/plain parts when more than one is + available, by selecting the first one only. This requires the + prior detection of text/html parts in order to exclude the + property or not. + 2011-02-11 Wolfgang Sourdeau * OpenChange/MAPIStoreContext.m diff --git a/OpenChange/MAPIStoreMailMessageTable.m b/OpenChange/MAPIStoreMailMessageTable.m index fa00b8f3b..988c7a9d7 100644 --- a/OpenChange/MAPIStoreMailMessageTable.m +++ b/OpenChange/MAPIStoreMailMessageTable.m @@ -331,28 +331,26 @@ static EOQualifier *nonDeletedQualifier = nil; case PR_BODY_UNICODE: { NSMutableArray *keys; - NSArray *acceptedTypes; child = [self lookupChild: childKey]; - acceptedTypes = [NSArray arrayWithObjects: @"text/plain", - @"text/html", nil]; keys = [NSMutableArray array]; [child addRequiredKeysOfStructure: [child bodyStructure] path: @"" toArray: keys - acceptedTypes: acceptedTypes]; - if ([keys count] == 0 || [keys count] == 2) + acceptedTypes: [NSArray arrayWithObject: + @"text/html"]]; + if ([keys count] > 0) { *data = NULL; rc = MAPI_E_NOT_FOUND; } else { - acceptedTypes = [NSArray arrayWithObject: @"text/plain"]; [keys removeAllObjects]; [child addRequiredKeysOfStructure: [child bodyStructure] path: @"" toArray: keys - acceptedTypes: acceptedTypes]; + acceptedTypes: [NSArray arrayWithObject: + @"text/plain"]]; if ([keys count] > 0) { id result;