From 9cc67638b406f1f7a45de0cb28cab8601909082e Mon Sep 17 00:00:00 2001 From: helge Date: Thu, 14 Jul 2005 12:28:46 +0000 Subject: [PATCH] added support for shared inboxes git-svn-id: http://svn.opengroupware.org/SOGo/trunk@750 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/SoObjects/Mailer/ChangeLog | 9 ++++ SOGo/SoObjects/Mailer/GNUmakefile | 1 + SOGo/SoObjects/Mailer/SOGoSharedInboxFolder.h | 44 +++++++++++++++++++ SOGo/SoObjects/Mailer/SOGoSharedInboxFolder.m | 43 ++++++++++++++++++ SOGo/SoObjects/Mailer/SOGoSharedMailAccount.m | 9 +++- SOGo/SoObjects/Mailer/Version | 2 +- SOGo/SoObjects/Mailer/product.plist | 3 ++ 7 files changed, 108 insertions(+), 3 deletions(-) create mode 100644 SOGo/SoObjects/Mailer/SOGoSharedInboxFolder.h create mode 100644 SOGo/SoObjects/Mailer/SOGoSharedInboxFolder.m diff --git a/SOGo/SoObjects/Mailer/ChangeLog b/SOGo/SoObjects/Mailer/ChangeLog index 2e663326..92fbc401 100644 --- a/SOGo/SoObjects/Mailer/ChangeLog +++ b/SOGo/SoObjects/Mailer/ChangeLog @@ -1,5 +1,14 @@ 2005-07-14 Helge Hess + * v0.9.102 + + * SOGoSharedMailAccount.m: create an object of class + SOGoSharedInboxFolder in case the lookup key is INBOX + + * added SOGoSharedInboxFolder.m for inboxes of shared mail accounts + (which have a different location than standard inboxes and never + contain subfolders) + * SOGoSharedMailAccount.m: prepared code to support a shared INBOX folder (v0.9.101) diff --git a/SOGo/SoObjects/Mailer/GNUmakefile b/SOGo/SoObjects/Mailer/GNUmakefile index 6a8207ca..916836d1 100644 --- a/SOGo/SoObjects/Mailer/GNUmakefile +++ b/SOGo/SoObjects/Mailer/GNUmakefile @@ -16,6 +16,7 @@ Mailer_OBJC_FILES += \ SOGoMailAccount.m \ SOGoSharedMailAccount.m \ SOGoMailFolder.m \ + SOGoSharedInboxFolder.m \ SOGoMailObject.m \ SOGoMailFolderDataSource.m \ SOGoTrashFolder.m \ diff --git a/SOGo/SoObjects/Mailer/SOGoSharedInboxFolder.h b/SOGo/SoObjects/Mailer/SOGoSharedInboxFolder.h new file mode 100644 index 00000000..1e597b30 --- /dev/null +++ b/SOGo/SoObjects/Mailer/SOGoSharedInboxFolder.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2004-2005 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. +*/ + +#ifndef __Mailer_SOGoSharedInboxFolder_H__ +#define __Mailer_SOGoSharedInboxFolder_H__ + +#include + +/* + SOGoSharedInboxFolder + Parent object: the SOGoSharedMailAccount + Child objects: SOGoMailObject or SOGoMailFolder + + The SOGoSharedInboxFolder is a special SOGoMailFolder for use as the INBOX + og SOGoSharedMailAccounts. This is necessary because the INBOX location in + the IMAP4 server is different for shared boxes (its the shared user folder, + not a mapped subfolder). +*/ + +@interface SOGoSharedInboxFolder : SOGoMailFolder +{ +} + +@end + +#endif /* __Mailer_SOGoSharedInboxFolder_H__ */ diff --git a/SOGo/SoObjects/Mailer/SOGoSharedInboxFolder.m b/SOGo/SoObjects/Mailer/SOGoSharedInboxFolder.m new file mode 100644 index 00000000..d5e444bf --- /dev/null +++ b/SOGo/SoObjects/Mailer/SOGoSharedInboxFolder.m @@ -0,0 +1,43 @@ +/* + Copyright (C) 2004-2005 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. +*/ + +#include "SOGoSharedInboxFolder.h" +#include "common.h" + +@implementation SOGoSharedInboxFolder + +/* listing available folders */ + +- (NSArray *)toManyRelationshipKeys { + /* + A shared INBOX has no subfolders because those are already shown as + subfolders of the account. + */ + return nil; +} + +/* IMAP4 locator */ + +- (NSURL *)imap4URL { + return [[self container] imap4URL]; +} + +@end /* SOGoSharedInboxFolder */ diff --git a/SOGo/SoObjects/Mailer/SOGoSharedMailAccount.m b/SOGo/SoObjects/Mailer/SOGoSharedMailAccount.m index eb509f7f..9aa194c5 100644 --- a/SOGo/SoObjects/Mailer/SOGoSharedMailAccount.m +++ b/SOGo/SoObjects/Mailer/SOGoSharedMailAccount.m @@ -23,7 +23,12 @@ #include "common.h" @interface SOGoMailAccount(UsedPrivates) + - (NSString *)imap4URLString; + +- (id)lookupFolder:(NSString *)_key ofClassNamed:(NSString *)_cn + inContext:(id)_cx; + @end @implementation SOGoSharedMailAccount @@ -107,8 +112,8 @@ static NSString *otherUsersFolderName = @""; // TODO: add English default The first INBOX is auto-assigned for the user by Cyrus, the second entry is actually the INBOX of the mailbox itself (alienor.a). */ - [self logWithFormat:@"TODO: return shared Inbox folder ..."]; - return nil; + return [self lookupFolder:_key ofClassNamed:@"SOGoSharedInboxFolder" + inContext:_ctx]; } - (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag { diff --git a/SOGo/SoObjects/Mailer/Version b/SOGo/SoObjects/Mailer/Version index 57886007..d33008ba 100644 --- a/SOGo/SoObjects/Mailer/Version +++ b/SOGo/SoObjects/Mailer/Version @@ -1,6 +1,6 @@ # Version file -SUBMINOR_VERSION:=101 +SUBMINOR_VERSION:=102 # v0.9.96 requires libNGMime v4.5.223 # v0.9.91 requires libNGMime v4.5.222 diff --git a/SOGo/SoObjects/Mailer/product.plist b/SOGo/SoObjects/Mailer/product.plist index 2ff6de49..1171c1ae 100644 --- a/SOGo/SoObjects/Mailer/product.plist +++ b/SOGo/SoObjects/Mailer/product.plist @@ -32,6 +32,9 @@ "Add Folders" = "Owner"; }; }; + SOGoSharedInboxFolder = { + superclass = "SOGoMailFolder"; + }; SOGoTrashFolder = { superclass = "SOGoMailFolder"; -- 2.39.5