Browse Source

IOS-2794 _removeInvalidHeadersFromMessage

IOS-2794
Dirk Zimmermann 1 year ago
parent
commit
fee9757a1a
1 changed files with 12 additions and 26 deletions
  1. +12
    -26
      pantomime-lib/Framework/Pantomime/CWIMAPFolder.m

+ 12
- 26
pantomime-lib/Framework/Pantomime/CWIMAPFolder.m View File

@ -769,35 +769,21 @@
//
- (NSData *) _removeInvalidHeadersFromMessage: (NSData *) theMessage
{
NSMutableData *aMutableData;
NSArray *allLines;
NSUInteger i, count;
// We allocate our mutable data object
aMutableData = [[NSMutableData alloc] initWithCapacity: [theMessage length]];
// We allocate our mutable data object
NSMutableData *aMutableData = [[NSMutableData alloc] initWithCapacity: [theMessage length]];
// We now replace all \n by \r\n
allLines = [theMessage componentsSeparatedByCString: "\n"];
count = [allLines count];
for (i = 0; i < count; i++)
{
NSData *aLine;
// We get a line...
aLine = [allLines objectAtIndex: i];
// We skip dumb headers
if ([aLine hasCPrefix: "From "])
{
continue;
}
// We now replace all \n by \r\n
[theMessage componentsSeparatedByCString:"\n" block:^(NSData *aLine, NSUInteger count) {
// We skip dumb headers
if ([aLine hasCPrefix: "From "]) {
return;
}
[aMutableData appendData: aLine];
[aMutableData appendCString: "\r\n"];
}
[aMutableData appendData: aLine];
[aMutableData appendCString: "\r\n"];
}];
return AUTORELEASE(aMutableData);
return AUTORELEASE(aMutableData);
}
@end


Loading…
Cancel
Save