diff --git a/ChangeLog b/ChangeLog index 6f2d77db6..3d8206ef9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-10-29 Wolfgang Sourdeau + * SoObjects/Mailer/SOGoMailBodyPart.m ([SOGoMailBodyPart + -davContentType]): ignore any possible parameter taken from the + mime-info of the body part. + * UI/MailerUI/UIxMailListView.m ([UIxMailListView -lastFirstMessageNumber]): new accessor that returns the first message number of the last series of messages. diff --git a/SoObjects/Mailer/SOGoMailBodyPart.m b/SoObjects/Mailer/SOGoMailBodyPart.m index d1a1f42fe..550fc04a5 100644 --- a/SoObjects/Mailer/SOGoMailBodyPart.m +++ b/SoObjects/Mailer/SOGoMailBodyPart.m @@ -236,20 +236,24 @@ static BOOL debugOn = NO; return @"application/octet-stream"; } -- (NSString *)davContentType { +- (NSString *) davContentType +{ // TODO: what about the content-type and other headers? // => we could pass them in as the extension? (eg generate 1.gif!) - NSString *pe; + NSString *parts, *contentType, *extension; /* try type from body structure info */ - if ((pe = [self contentTypeForBodyPartInfo:[self partInfo]]) != nil) - return pe; - - /* construct type */ - - pe = [[self nameInContainer] pathExtension]; - return [self contentTypeForPathExtension:pe]; + parts = [self contentTypeForBodyPartInfo: [self partInfo]]; + contentType = [[parts componentsSeparatedByString: @";"] objectAtIndex: 0]; + + if (![contentType length]) + { + extension = [[self nameInContainer] pathExtension]; + contentType = [self contentTypeForPathExtension: extension]; + } + + return contentType; } /* actions */