Monotone-Parent: c43365ce39a0e96a47c78f5b1c8fc7c645bd92bb

Monotone-Revision: ca25951dfbee297d267083be969272c32a52477c

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-08-20T20:43:08
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-08-20 20:43:08 +00:00
parent 090c522ddb
commit cb176fe421
2 changed files with 25 additions and 24 deletions
+4
View File
@@ -1,5 +1,9 @@
2007-08-20 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Mailer/SOGoMailBodyPart.m ([SOGoMailBodyPart
-lookupName:_keyinContext:_ctxacquire:_flag]): do not require the
filename to have an extension, and thus accept any filename.
* UI/Contacts/UIxContactsListView.m ([UIxContactsListView
-currentCName]): new method that returns the c_name of the
contact, correctly escaped to be passed by url afterwards.
+21 -24
View File
@@ -131,39 +131,36 @@ static BOOL debugOn = NO;
/* name lookup */
- (id)lookupImap4BodyPartKey:(NSString *)_key inContext:(id)_ctx {
- (id) lookupImap4BodyPartKey: (NSString *) _key
inContext: (id) _ctx
{
// TODO: we might want to check for existence prior controller creation
Class clazz;
clazz = [SOGoMailBodyPart bodyPartClassForKey:_key inContext:_ctx];
return [[[clazz alloc] initWithName:_key inContainer:self] autorelease];
return [clazz objectWithName: _key inContainer: self];
}
- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
- (id) lookupName: (NSString *) _key
inContext: (id) _ctx
acquire: (BOOL) _flag
{
id obj;
/* first check attributes directly bound to the application */
if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]) != nil)
return obj;
/* lookup body part */
if ([self isBodyPartKey:_key inContext:_ctx]) {
if ((obj = [self lookupImap4BodyPartKey:_key inContext:_ctx]) != nil)
return obj;
}
/*
Treat other keys which have a path-extension as 'virtual' noops to allow
addition of path names to the attachment path, eg:
http://.../login@server/INBOX/1/2/3/MyDocument.pdf
*/
if ([[_key pathExtension] length] > 0)
return self;
/* return 404 to stop acquisition */
return [NSException exceptionWithHTTPStatus:404 /* Not Found */
reason:@"Did not find a subpart for the given name!"];
obj = [super lookupName:_key inContext:_ctx acquire:NO];
if (!obj)
{
/* lookup body part */
if ([self isBodyPartKey:_key inContext:_ctx])
obj = [self lookupImap4BodyPartKey:_key inContext:_ctx];
/* should check whether such a filename exist in the attached names */
if (!obj)
obj = self;
}
return obj;
}
/* fetch */