Skip to content

Commit

Permalink
Fix rendering of forwarded HTML message with img
Browse files Browse the repository at this point in the history
Fixes #3981 (cont'd)
  • Loading branch information
cgx committed Jan 13, 2017
1 parent 9d7d257 commit 4a21a02
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions SoObjects/Mailer/SOGoMailObject.m
Expand Up @@ -840,6 +840,7 @@ - (void) _fetchFileAttachmentKey: (NSDictionary *) part
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];
Expand Down
3 changes: 2 additions & 1 deletion UI/MailPartViewers/UIxMailPartHTMLViewer.m
Expand Up @@ -609,7 +609,8 @@ - (void) startElement: (NSString *) _localName
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);
}
Expand Down
7 changes: 6 additions & 1 deletion UI/MailerUI/UIxMailView.m
Expand Up @@ -215,15 +215,20 @@ - (id) contentViewerComponent

NSMutableDictionary *attachmentIds;
NSDictionary *attributes;
NSString *filename;
unsigned int count, max;

max = [[self attachmentAttrs] count];
attachmentIds = [NSMutableDictionary dictionaryWithCapacity: max];
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];

Expand Down

0 comments on commit 4a21a02

Please sign in to comment.