Fix rendering of forwarded HTML message with img

Fixes #3981 (cont'd)
This commit is contained in:
Francis Lachapelle
2017-01-13 12:23:38 -05:00
parent 9d7d2575d3
commit 4a21a02f98
3 changed files with 9 additions and 2 deletions
+1
View File
@@ -840,6 +840,7 @@ static BOOL debugSoParts = NO;
path, @"path",
[part objectForKey: @"encoding"], @"encoding",
[part objectForKey:@ "size"], @"size",
[part objectForKey: @"bodyId"], @"bodyId",
[NSString stringWithFormat: @"%@/%@", prefix, filenameURL], @"url",
[NSString stringWithFormat: @"%@/asAttachment/%@", prefix, filenameURL], @"urlAsAttachment",
nil];
+2 -1
View File
@@ -609,7 +609,8 @@ static NSData* _sanitizeContent(NSData *theData)
value = [_attributes valueAtIndex: count];
if ([value hasPrefix: @"cid:"])
{
cid = [value substringFromIndex: 4];
cid = [NSString stringWithFormat: @"<%@>",
[value substringFromIndex: 4]];
value = [attachmentIds objectForKey: cid];
skipAttribute = (value == nil);
}
+6 -1
View File
@@ -215,6 +215,7 @@ static NSString *mailETag = nil;
NSMutableDictionary *attachmentIds;
NSDictionary *attributes;
NSString *filename;
unsigned int count, max;
max = [[self attachmentAttrs] count];
@@ -222,8 +223,12 @@ static NSString *mailETag = nil;
for (count = 0; count < max; count++)
{
attributes = [[self attachmentAttrs] objectAtIndex: count];
filename = [NSString stringWithFormat: @"<%@>", [attributes objectForKey: @"filename"]];
[attachmentIds setObject: [attributes objectForKey: @"url"]
forKey: [attributes objectForKey: @"filename"]];
forKey: filename];
if ([[attributes objectForKey: @"bodyId"] length])
[attachmentIds setObject: [attributes objectForKey: @"url"]
forKey: [attributes objectForKey: @"bodyId"]];
}
[viewer setAttachmentIds: attachmentIds];