Monotone-Parent: e3bbd9a60cde2c4234f17f311a214c5355c7564b

Monotone-Revision: efcdad4329c6673a9cb8cdf84b3e4facd4cf680e

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-08-20T20:44:11
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2007-08-20 20:44:11 +00:00
parent d8f4bc848f
commit 5b32ace1a4
2 changed files with 23 additions and 36 deletions

View File

@ -1,5 +1,9 @@
2007-08-20 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/MailPartViewers/UIxMailPartViewer.m ([UIxMailPartViewer
-pathToAttachmentObject]): we no longer need the filename
extension for SoLookup...
* SoObjects/Mailer/SOGoMailBodyPart.m ([SOGoMailBodyPart
-lookupName:_keyinContext:_ctxacquire:_flag]): do not require the
filename to have an extension, and thus accept any filename.

View File

@ -316,52 +316,35 @@
if ([(n = [partPath componentsJoinedByString:@"/"]) isNotNull])
url = [url stringByAppendingString:n];
/* we currently NEED the extension for SoObject lookup (should be fixed) */
pext = [self preferredPathExtension];
if ([pext isNotNull] && [pext length] > 0)
{
/* attach extension */
if ([url hasSuffix:@"/"]) {
/* this happens if the part is the root-content of the mail */
url = [url substringToIndex:([url length] - 1)];
}
url = [url stringByAppendingString:@"."];
url = [url stringByAppendingString:pext];
}
return url;
}
- (NSString *) pathToAttachment
{
/* this generates a more beautiful 'download' URL for a part */
NSString *url, *fn;
NSString *fn;
NSMutableString *url;
fn = [self filename];
if (![fn isNotNull] || ([fn length] == 0))
fn = nil;
/* get basic URL */
url = [self pathToAttachmentObject];
/*
If we have an attachment name, we attach it, this is properly handled by
SOGoMailBodyPart.
*/
if (fn)
fn = [self filename];
if ([fn length] > 0)
{
/* get basic URL */
url = [NSMutableString stringWithString: [self pathToAttachmentObject]];
/*
If we have an attachment name, we attach it, this is properly handled by
SOGoMailBodyPart.
*/
if (![url hasSuffix: @"/"])
url = [url stringByAppendingString: @"/"];
if (isdigit([fn characterAtIndex:0]))
url = [url stringByAppendingString: @"fn-"];
url = [url stringByAppendingString: [fn stringByEscapingURL]];
// TODO: should we check for a proper extension?
[url appendString: @"/"];
if (isdigit([url characterAtIndex: 0]))
[url appendString: @"fn-"];
[url appendString: [fn stringByEscapingURL]];
// TODO: should we check for a proper extension?
}
else
url = nil;
return url;
}