Monotone-Parent: e3bbd9a60cde2c4234f17f311a214c5355c7564b
Monotone-Revision: efcdad4329c6673a9cb8cdf84b3e4facd4cf680e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-08-20T20:44:11 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
d8f4bc848f
commit
5b32ace1a4
|
@ -1,5 +1,9 @@
|
||||||
2007-08-20 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
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
|
* SoObjects/Mailer/SOGoMailBodyPart.m ([SOGoMailBodyPart
|
||||||
-lookupName:_keyinContext:_ctxacquire:_flag]): do not require the
|
-lookupName:_keyinContext:_ctxacquire:_flag]): do not require the
|
||||||
filename to have an extension, and thus accept any filename.
|
filename to have an extension, and thus accept any filename.
|
||||||
|
|
|
@ -316,52 +316,35 @@
|
||||||
if ([(n = [partPath componentsJoinedByString:@"/"]) isNotNull])
|
if ([(n = [partPath componentsJoinedByString:@"/"]) isNotNull])
|
||||||
url = [url stringByAppendingString:n];
|
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;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) pathToAttachment
|
- (NSString *) pathToAttachment
|
||||||
{
|
{
|
||||||
/* this generates a more beautiful 'download' URL for a part */
|
/* this generates a more beautiful 'download' URL for a part */
|
||||||
NSString *url, *fn;
|
NSString *fn;
|
||||||
|
NSMutableString *url;
|
||||||
|
|
||||||
fn = [self filename];
|
fn = [self filename];
|
||||||
|
if ([fn length] > 0)
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
|
/* 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: @"/"])
|
if (![url hasSuffix: @"/"])
|
||||||
url = [url stringByAppendingString: @"/"];
|
[url appendString: @"/"];
|
||||||
if (isdigit([fn characterAtIndex:0]))
|
if (isdigit([url characterAtIndex: 0]))
|
||||||
url = [url stringByAppendingString: @"fn-"];
|
[url appendString: @"fn-"];
|
||||||
url = [url stringByAppendingString: [fn stringByEscapingURL]];
|
[url appendString: [fn stringByEscapingURL]];
|
||||||
|
// TODO: should we check for a proper extension?
|
||||||
// TODO: should we check for a proper extension?
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
url = nil;
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue