fix(mail): use unique names for attachments

Fixes #5086
This commit is contained in:
Francis Lachapelle committed 2020-07-23 12:56:35 -04:00
1 parent d549c296ae
commit 9c391b8d8d
5 files changed
+44 -28

No files matched your search

+9 -9
View File
@@ -525,10 +525,9 @@ static NSArray *infoKeys = nil;
return newFilename;
}
- (NSDictionary *) _scanAttachmentFilenamesInRequest: (id) httpBody
- (NSMutableDictionary *) _scanAttachmentFilenamesInRequest: (id) httpBody
{
NSMutableDictionary *files;
NSDictionary *file;
NSMutableDictionary *files, *file;
NSArray *parts;
unsigned int count, max;
NGMimeBodyPart *part;
@@ -547,11 +546,11 @@ static NSArray *infoKeys = nil;
{
mimeType = [(NGMimeType *)[part headerForKey: @"content-type"] stringValue];
filename = [self _fixedFilename: [header filename]];
file = [NSDictionary dictionaryWithObjectsAndKeys:
filename, @"filename",
mimeType, @"mimetype",
[part body], @"body",
nil];
file = [NSMutableDictionary dictionaryWithObjectsAndKeys:
filename, @"filename",
mimeType, @"mimetype",
[part body], @"body",
nil];
[files setObject: file forKey: [NSString stringWithFormat: @"%@_%@", [header name], filename]];
}
}
@@ -564,7 +563,8 @@ static NSArray *infoKeys = nil;
NSException *error;
WORequest *request;
NSEnumerator *allAttachments;
NSDictionary *attrs, *filenames;
NSMutableDictionary *attrs;
NSDictionary *filenames;
id httpBody;
SOGoDraftObject *co;