feat(mail): initial support for ms-tnef (winmail.dat) body part

Fixes #2242
Fixes #4503
This commit is contained in:
Francis Lachapelle authored and GitHub committed 2021-08-13 11:12:37 -04:00
1 parent 98dad1d2dc
commit 045f134321
36 files changed
+3639 -34

No files matched your search

+5 -15
View File
@@ -180,11 +180,6 @@ static NSString *mailETag = nil;
return attachmentAttrs;
}
- (BOOL) hasAttachments
{
return [[self attachmentAttrs] count] > 0 ? YES : NO;
}
- (NSFormatter *) sizeFormatter
{
return [UIxMailSizeFormatter sharedMailSizeFormatter];
@@ -199,14 +194,6 @@ static NSString *mailETag = nil;
return [formatter stringForObjectValue: [[self clientObject] date]];
}
- (NSString *) attachmentsText
{
if ([[self attachmentAttrs] count] > 1)
return [self labelForKey: @"files"];
else
return [self labelForKey: @"file"];
}
/* viewers */
//
@@ -287,6 +274,7 @@ static NSString *mailETag = nil;
SOGoMailObject *co;
UIxEnvelopeAddressFormatter *addressFormatter;
UIxMailRenderingContext *mctx;
id viewer, renderedPart;
co = [self clientObject];
addressFormatter = [context mailEnvelopeAddressFormatter];
@@ -338,11 +326,13 @@ static NSString *mailETag = nil;
andJSONRepresentation: data];
}
viewer = [self contentViewerComponent]; // set attachmentIds for common parts
renderedPart = [viewer renderedPart]; // set attachmentIds for encrypted & TNEF parts
data = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[self attachmentAttrs], @"attachmentAttrs",
[self shouldAskReceipt], @"shouldAskReceipt",
[NSNumber numberWithBool: [self mailIsDraft]], @"isDraft",
[[self contentViewerComponent] renderedPart], @"parts",
renderedPart, @"parts",
nil];
if ([self formattedDate])
[data setObject: [self formattedDate] forKey: @"date"];