Fix attachment path when inside multiple parts

This commit is contained in:
Francis Lachapelle
2017-04-06 14:31:41 -04:00
parent b9f4947f8a
commit ed3f794226
2 changed files with 12 additions and 2 deletions
+11 -2
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";
}