merge of '397fde917fae54c68a56446340e43b77444b00e1'

and 'e9584ae6fb22159a5f2cace0641d3a58c6816280'

Monotone-Parent: 397fde917fae54c68a56446340e43b77444b00e1
Monotone-Parent: e9584ae6fb22159a5f2cace0641d3a58c6816280
Monotone-Revision: 748fb7eea98a07ee1396f6902a6b0fb3e52f280e

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2007-11-21T15:09:33
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2007-11-21 15:09:33 +00:00
4 changed files with 30 additions and 15 deletions

View File

@@ -1,3 +1,13 @@
2007-11-21 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject
-lookupImap4BodyPartKey:inContext:]): return a correct body part
when "0" is requested, taking its mime-type into account.
* UI/MailPartViewers/UIxMailRenderingContext.m
([UIxMailRenderingContext -flatContentForPartPath:_partPath]):
return content for part "0", which would be the message body.
2007-11-20 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/MailPartViewers/UIxMailPartHTMLViewer.m

View File

@@ -368,14 +368,11 @@ static BOOL debugOn = NO;
classString = @"SOGoMessageMailBodyPart";
else
{
NSLog (@"unhandled mime type: '%@'", mimeType);
classString = nil;
classString = @"SOGoMailBodyPart";
// NSLog (@"unhandled mime type: '%@'", mimeType);
}
if (classString)
klazz = NSClassFromString (classString);
else
klazz = [SOGoMailBodyPart class];
klazz = NSClassFromString (classString);
return klazz;
}

View File

@@ -756,22 +756,26 @@ static BOOL debugSoParts = NO;
/* We don't have parts here but we're trying to download the message's
content that could be an image/jpeg, as an example */
if ([parts count] == 0)
if ([parts count] == 0 && ![_key intValue])
partDesc = [self bodyStructure];
else
{
return [SOGoMailBodyPart objectWithName: @"1" inContainer: self];
part = [_key intValue] - 1;
if (part > -1 && part < [parts count])
partDesc = [parts objectAtIndex: part];
else
partDesc = nil;
}
part = [_key intValue] - 1;
if (part > -1 && part < [parts count])
if (partDesc)
{
partDesc = [parts objectAtIndex: part];
mimeType = [[partDesc keysWithFormat: @"%{type}/%{subtype}"] lowercaseString];
clazz = [SOGoMailBodyPart bodyPartClassForMimeType: mimeType
inContext: _ctx];
}
else
clazz = Nil;
return [clazz objectWithName:_key inContainer: self];
}

View File

@@ -117,10 +117,14 @@ static BOOL showNamedTextAttachmentsInline = NO;
- (NSData *) flatContentForPartPath: (NSArray *) _partPath
{
NSString *pid;
pid = _partPath ? [_partPath componentsJoinedByString:@"."] : @"";
NSData *content;
return [[self flatContents] objectForKey:pid];
pid = _partPath ? [_partPath componentsJoinedByString: @"."] : @"";
content = [[self flatContents] objectForKey: pid];
if (!content && ![pid intValue])
content = [flatContents objectForKey: @""];
return content;
}
/* viewer components */