Monotone-Parent: a0e83a1784478d41763fc4ebb3eb9ee8a5142b5a

Monotone-Revision: 55595f6ee3aaa33db773a4eb60c184519b6f18fd

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-10-31T19:28:22
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2011-10-31 19:28:22 +00:00
parent 506ad03bab
commit 2a93ea4e6d
6 changed files with 36 additions and 10 deletions
+12 -6
View File
@@ -527,6 +527,7 @@ static BOOL debugSoParts = NO;
path: (NSString *) p
toArray: (NSMutableArray *) keys
acceptedTypes: (NSArray *) types
withPeek: (BOOL) withPeek
{
/*
This is used to collect the set of IMAP4 fetch-keys required to fetch
@@ -539,9 +540,11 @@ static BOOL debugSoParts = NO;
unsigned i, count;
NSString *k;
id body;
NSString *sp, *mimeType;
NSString *bodyToken, *sp, *mimeType;
id childInfo;
bodyToken = (withPeek ? @"body.peek" : @"body");
mimeType = [[NSString stringWithFormat: @"%@/%@",
[info valueForKey: @"type"],
[info valueForKey: @"subtype"]]
@@ -549,7 +552,7 @@ static BOOL debugSoParts = NO;
if ([types containsObject: mimeType])
{
if ([p length] > 0)
k = [NSString stringWithFormat: @"body[%@]", p];
k = [NSString stringWithFormat: @"%@[%@]", bodyToken, p];
else
{
/*
@@ -557,7 +560,7 @@ static BOOL debugSoParts = NO;
entities?
TODO: check with HTML
*/
k = @"body[text]";
k = [NSString stringWithFormat: @"%@[text]", bodyToken];
}
[keys addObject: [NSDictionary dictionaryWithObjectsAndKeys: k, @"key",
mimeType, @"mimeType", nil]];
@@ -575,7 +578,8 @@ static BOOL debugSoParts = NO;
[self addRequiredKeysOfStructure: childInfo
path: sp toArray: keys
acceptedTypes: types];
acceptedTypes: types
withPeek: withPeek];
}
/* check body */
@@ -600,7 +604,8 @@ static BOOL debugSoParts = NO;
sp = [p length] > 0 ? (id)[p stringByAppendingString: @".1"] : (id)@"1";
[self addRequiredKeysOfStructure: body
path: sp toArray: keys
acceptedTypes: types];
acceptedTypes: types
withPeek: withPeek];
}
}
@@ -618,7 +623,8 @@ static BOOL debugSoParts = NO;
@"application/pgp-signature", nil];
ma = [NSMutableArray arrayWithCapacity: 4];
[self addRequiredKeysOfStructure: [self bodyStructure]
path: @"" toArray: ma acceptedTypes: types];
path: @"" toArray: ma acceptedTypes: types
withPeek: NO];
return ma;
}