Monotone-Parent: 55595f6ee3aaa33db773a4eb60c184519b6f18fd

Monotone-Revision: 9488bb1220eb58936dc8d649bae5b7ecf2fe01fc

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-10-31T19:29:37
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2011-10-31 19:29:37 +00:00
parent 2a93ea4e6d
commit 4da013c4e3
3 changed files with 15 additions and 4 deletions

View File

@@ -76,7 +76,7 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
NSRange bodyRange;
NSString *strippedKey;
bodyRange = [self rangeOfString: @"body["];
bodyRange = [self rangeOfString: @"body.peek["];
if (bodyRange.length > 0)
{
strippedKey = [self substringFromIndex: NSMaxRange (bodyRange)];
@@ -211,7 +211,8 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
keys = [NSMutableArray array];
[sogoObject addRequiredKeysOfStructure: [sogoObject bodyStructure]
path: @"" toArray: keys
acceptedTypes: acceptedTypes];
acceptedTypes: acceptedTypes
withPeek: YES];
[keys sortUsingFunction: _compareBodyKeysByPriority context: acceptedTypes];
if ([keys count] > 0)
{
@@ -234,6 +235,7 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
- (void) _fetchBodyData
{
NSData *rawContent;
NSString *resultKey;
id result;
if (!headerSetup)
@@ -243,7 +245,12 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
{
result = [sogoObject fetchParts: [NSArray arrayWithObject: mimeKey]];
result = [[result valueForKey: @"RawResponse"] objectForKey: @"fetch"];
rawContent = [[result objectForKey: mimeKey] objectForKey: @"data"];
if ([mimeKey hasPrefix: @"body.peek"])
resultKey = [NSString stringWithFormat: @"body[%@]",
[mimeKey _strippedBodyKey]];
else
resultKey = mimeKey;
rawContent = [[result objectForKey: resultKey] objectForKey: @"data"];
ASSIGN (bodyContent, [rawContent bodyDataFromEncoding: headerEncoding]);
}