From 5b2e15b0abc95ec33e806ed755405626594b5b42 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 29 Oct 2007 21:00:35 +0000 Subject: [PATCH] Monotone-Parent: 3e73bc9e2ac67c257e07beaab3ae5c3a2c1f7479 Monotone-Revision: 9bdbe760f39fa9a2561fe56ce9dac03727cfb38f Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-10-29T21:00:35 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ SoObjects/Mailer/SOGoMailBodyPart.m | 22 +++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) 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 */