Monotone-Parent: c611aac3a435306dc4b8733414bd22f705466261

Monotone-Revision: 981dc1193bc46a857c02066a7e299b5ec4658e43

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-01-06T14:36:17
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2010-01-06 14:36:17 +00:00
parent 63c787e759
commit 1b4c0de728
2 changed files with 46 additions and 0 deletions

View File

@ -1,5 +1,9 @@
2010-01-06 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Mailer/SOGoMailNamespace.m
(-lookupName:inContext:acquire:): overriden method because the
namespace "folders" cannot be created and cannot contain messages.
* SoObjects/Mailer/SOGoMailAccount.m
(-otherUsersFolderNamespaces): new method that returns all the
namespace "folders" in the "other user" namespace. Replaces the

View File

@ -20,6 +20,10 @@
* Boston, MA 02111-1307, USA.
*/
#import <SOGo/NSString+Utilities.h>
#import "SOGoMailAccount.h"
#import "SOGoMailNamespace.h"
@implementation SOGoMailNamespace
@ -29,4 +33,42 @@
return nil;
}
- (id) lookupName: (NSString *) _key
inContext: (id)_ctx
acquire: (BOOL) _acquire
{
NSString *folderName, *fullFolderName, *className;
SOGoMailAccount *mailAccount;
id obj;
if ([_key hasPrefix: @"folder"])
{
mailAccount = [self mailAccountFolder];
folderName = [[_key substringFromIndex: 6] fromCSSIdentifier];
fullFolderName = [NSString stringWithFormat: @"%@/%@",
[self traversalFromMailAccount], folderName];
if ([fullFolderName
isEqualToString: [mailAccount sentFolderNameInContext: _ctx]])
className = @"SOGoSentFolder";
else if ([fullFolderName isEqualToString:
[mailAccount draftsFolderNameInContext: _ctx]])
className = @"SOGoDraftsFolder";
else if ([fullFolderName isEqualToString:
[mailAccount trashFolderNameInContext: _ctx]])
className = @"SOGoTrashFolder";
/* else if ([folderName isEqualToString:
[mailAccount sieveFolderNameInContext: _ctx]])
obj = [self lookupFiltersFolder: _key inContext: _ctx]; */
else
className = @"SOGoMailFolder";
obj = [NSClassFromString (className) objectWithName: _key
inContainer: self];
}
else
obj = [super lookupName: _key inContext: _ctx acquire: NO];
return obj;
}
@end