Fix attachment path when inside multiple parts

pull/235/head
Francis Lachapelle 2017-04-06 14:31:41 -04:00
parent b9f4947f8a
commit ed3f794226
2 changed files with 12 additions and 2 deletions

1
NEWS
View File

@ -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)

View File

@ -340,12 +340,21 @@
- (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";
}