See ChangeLog

Monotone-Parent: 5a6d160e6f9616edb725a40e08f24f0f0bf539b0
Monotone-Revision: 173ccf9cd4cd08cdc361da9d58df641be065e5a5

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2012-07-20T18:17:06
maint-2.0.2
Ludovic Marcotte 2012-07-20 18:17:06 +00:00
parent 5c618e5638
commit f363ddf101
2 changed files with 16 additions and 7 deletions

View File

@ -1,3 +1,9 @@
2012-07-20 Ludovic Marcotte <lmarcotte@inverse.ca>
* UI/MailPartViewers/UIxMailRenderingContext.m
(_shouldDisplayAsAttachment:): refactored to consider
the "bodyId" parameter only for non text/* parts.
2012-07-20 Francis Lachapelle <flachapelle@inverse.ca> 2012-07-20 Francis Lachapelle <flachapelle@inverse.ca>
* UI/MailPartViewers/UIxMailPartHTMLViewer.m * UI/MailPartViewers/UIxMailPartHTMLViewer.m

View File

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