From: helge Date: Wed, 6 Oct 2004 15:45:06 +0000 (+0000) Subject: started drafts folder X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5923d5a68c10e6325126ba1dff07ecbaae7f7fa9;p=scalable-opengroupware.org started drafts folder git-svn-id: http://svn.opengroupware.org/SOGo/trunk@367 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/SoObjects/Mailer/ChangeLog b/SOGo/SoObjects/Mailer/ChangeLog index fd6f649b..d06d9153 100644 --- a/SOGo/SoObjects/Mailer/ChangeLog +++ b/SOGo/SoObjects/Mailer/ChangeLog @@ -1,5 +1,7 @@ 2004-10-06 Helge Hess + * started SOGoDraftsFolder (v0.9.27) + * v0.9.26 * SOGoMailConnectionEntry.m: added caching of sorted UIDs sets diff --git a/SOGo/SoObjects/Mailer/GNUmakefile b/SOGo/SoObjects/Mailer/GNUmakefile index 2dc7d244..89ed10ed 100644 --- a/SOGo/SoObjects/Mailer/GNUmakefile +++ b/SOGo/SoObjects/Mailer/GNUmakefile @@ -18,6 +18,8 @@ Mailer_OBJC_FILES += \ SOGoMailFolder.m \ SOGoMailObject.m \ SOGoMailBodyPart.m \ + \ + SOGoDraftsFolder.m \ Mailer_RESOURCE_FILES += \ Version \ diff --git a/SOGo/SoObjects/Mailer/SOGoDraftsFolder.h b/SOGo/SoObjects/Mailer/SOGoDraftsFolder.h new file mode 100644 index 00000000..b0697bd0 --- /dev/null +++ b/SOGo/SoObjects/Mailer/SOGoDraftsFolder.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 2004 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ +// $Id$ + +#ifndef __Mailer_SOGoDraftsFolder_H__ +#define __Mailer_SOGoDraftsFolder_H__ + +#include + +/* + SOGoDraftsFolder + Parent object: SOGoMailAccount + Child objects: SOGoMailFolder + + The SOGoDraftsFolder is used for composing new messages. +*/ + +@interface SOGoDraftsFolder : SOGoMailBaseObject +{ +} + +@end + +#endif /* __Mailer_SOGoDraftsFolder_H__ */ diff --git a/SOGo/SoObjects/Mailer/SOGoDraftsFolder.m b/SOGo/SoObjects/Mailer/SOGoDraftsFolder.m new file mode 100644 index 00000000..3528bea4 --- /dev/null +++ b/SOGo/SoObjects/Mailer/SOGoDraftsFolder.m @@ -0,0 +1,28 @@ +/* + Copyright (C) 2004 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ +// $Id$ + +#include "SOGoDraftsFolder.h" +#include "common.h" + +@implementation SOGoDraftsFolder + +@end /* SOGoDraftsFolder */ diff --git a/SOGo/SoObjects/Mailer/SOGoMailAccount.m b/SOGo/SoObjects/Mailer/SOGoMailAccount.m index 229f197c..11f8a3c3 100644 --- a/SOGo/SoObjects/Mailer/SOGoMailAccount.m +++ b/SOGo/SoObjects/Mailer/SOGoMailAccount.m @@ -22,6 +22,7 @@ #include "SOGoMailAccount.h" #include "SOGoMailFolder.h" +#include "SOGoDraftsFolder.h" #include "common.h" @implementation SOGoMailAccount @@ -29,8 +30,8 @@ /* listing the available folders */ - (NSArray *)toManyRelationshipKeys { - // TODO: hardcoded, if we want to support shared folders, need to change */ - return [NSArray arrayWithObjects:@"INBOX", nil]; + // TODO: hardcoded, if we want to support shared fldrs, this needs to change + return [NSArray arrayWithObjects:@"INBOX", @"Drafts", nil]; } /* hierarchy */ @@ -74,6 +75,11 @@ inContainer:self] autorelease]; } +- (id)lookupDraftsFolder:(NSString *)_key inContext:(id)_ctx { + return [[[SOGoDraftsFolder alloc] initWithName:_key + inContainer:self] autorelease]; +} + - (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag { id obj; @@ -81,6 +87,11 @@ if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]) != nil) return obj; + if ([_key isEqualToString:@"Drafts"]) { + if ((obj = [self lookupDraftsFolder:_key inContext:_ctx]) != nil) + return obj; + } + if ((obj = [self lookupImap4Folder:_key inContext:_ctx]) != nil) return obj; diff --git a/SOGo/SoObjects/Mailer/SOGoMailManager.m b/SOGo/SoObjects/Mailer/SOGoMailManager.m index b3c507cf..49b1c03d 100644 --- a/SOGo/SoObjects/Mailer/SOGoMailManager.m +++ b/SOGo/SoObjects/Mailer/SOGoMailManager.m @@ -357,7 +357,7 @@ static NSTimeInterval PoolScanInterval = 5 * 60; uids = [entry cachedUIDsForURL:_url qualifier:_qualifier sortOrdering:_so]; if (uids != nil) { - [self logWithFormat:@"REUSE UID CACHE!"]; + if (debugCache) [self logWithFormat:@"reusing uid cache!"]; return [uids isNotNull] ? uids : nil; } diff --git a/SOGo/SoObjects/Mailer/Version b/SOGo/SoObjects/Mailer/Version index 9c8dad69..9461bed0 100644 --- a/SOGo/SoObjects/Mailer/Version +++ b/SOGo/SoObjects/Mailer/Version @@ -1,3 +1,3 @@ # $Id$ -SUBMINOR_VERSION:=26 +SUBMINOR_VERSION:=27