merge of '068bbe8f960b1a20f29054e83e54a57c4372a98e'

and '631e9fa8454aae26e4c7eaa71bfe9e18c0f4b7e5'

Monotone-Parent: 068bbe8f960b1a20f29054e83e54a57c4372a98e
Monotone-Parent: 631e9fa8454aae26e4c7eaa71bfe9e18c0f4b7e5
Monotone-Revision: 95a335681530001430a12707d05dbed7839214fb

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2012-07-20T20:03:48
This commit is contained in:
Francis Lachapelle committed 2012-07-20 20:03:48 +00:00
commit 1d26a4b725
3 files changed
+28 -7

No files matched your search

+10 -7
View File
@@ -32,22 +32,25 @@
@interface UIxMailRenderingContext (Private)
- (BOOL) _shouldDisplayAsAttachment: (NSDictionary *) info;
- (BOOL) _shouldDisplayAsAttachment: (NSDictionary *) info
textPart: (BOOL) textPart;
@end
@implementation UIxMailRenderingContext (Private)
- (BOOL) _shouldDisplayAsAttachment: (NSDictionary *) info
textPart: (BOOL) textPart
{
NSString *s;
BOOL shouldDisplay;
s = [[info objectForKey:@"disposition"] objectForKey: @"type"];
shouldDisplay = ((s && ([s caseInsensitiveCompare: @"ATTACHMENT"]
== NSOrderedSame))
|| [[info objectForKey: @"bodyId"] length]);
shouldDisplay = (s && ([s caseInsensitiveCompare: @"ATTACHMENT"]
== NSOrderedSame));
if (!shouldDisplay && !textPart)
shouldDisplay = ([[info objectForKey: @"bodyId"] length] ? YES : NO);
return shouldDisplay;
}
@@ -198,7 +201,7 @@ static BOOL showNamedTextAttachmentsInline = NO;
else if ([mt isEqualToString:@"text"])
{
if ([st isEqualToString:@"plain"] || [st isEqualToString:@"html"]) {
if (!showNamedTextAttachmentsInline && [self _shouldDisplayAsAttachment: _info])
if (!showNamedTextAttachmentsInline && [self _shouldDisplayAsAttachment: _info textPart:YES])
return [self linkViewer];
return [st isEqualToString:@"html"]
@@ -212,7 +215,7 @@ static BOOL showNamedTextAttachmentsInline = NO;
// Tiffs aren't well-supported
if ([mt isEqualToString:@"image"] && ![st isEqualToString: @"tiff"])
{
if ([self _shouldDisplayAsAttachment: _info])
if ([self _shouldDisplayAsAttachment: _info textPart: NO])
return [self linkViewer];
return [self imageViewer];