Skip to content

Commit

Permalink
Fix attachment path when inside multiple parts
Browse files Browse the repository at this point in the history
  • Loading branch information
cgx committed Apr 6, 2017
1 parent b9f4947 commit ed3f794
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -8,6 +8,7 @@ Enhancements
-

Bug fixes
- [web] fixed attachment path when inside multiple body parts
- [core] cherry-picked comma escaping fix from v2 (#3296)

3.2.8 (2017-03-24)
Expand Down
13 changes: 11 additions & 2 deletions UI/MailPartViewers/UIxMailPartViewer.m
Expand Up @@ -340,12 +340,21 @@ - (NSString *) _pathForAttachmentOrDownload: (BOOL) forDownload

- (NSString *) pathToAttachmentFromMessage
{
NSMutableArray *parts;
SOGoMailBodyPart *bodyPart;

bodyPart = [self clientPart];

if ([bodyPart isKindOfClass: [SOGoMailBodyPart class]])
return [NSString stringWithFormat: @"%@/%@", [bodyPart nameInContainer], [self _filenameForAttachment: bodyPart]];
{
parts = [NSMutableArray arrayWithObject: [self _filenameForAttachment: bodyPart]];
do
{
[parts insertObject: [bodyPart nameInContainer] atIndex: 0];
bodyPart = [bodyPart container];
}
while ([bodyPart isKindOfClass: [SOGoMailBodyPart class]]);
return [parts componentsJoinedByString: @"/"];
}

return @"0";
}
Expand Down

0 comments on commit ed3f794

Please sign in to comment.