From: helge Date: Thu, 14 Jul 2005 11:17:27 +0000 (+0000) Subject: use new clientObject share API in UI X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c50b39d5d70d406c347ce5d8f9804807a50fb94;p=scalable-opengroupware.org use new clientObject share API in UI prepared shared-mail account for special INBOX git-svn-id: http://svn.opengroupware.org/SOGo/trunk@748 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/SoObjects/Mailer/ChangeLog b/SOGo/SoObjects/Mailer/ChangeLog index 3bbbb707..2e663326 100644 --- a/SOGo/SoObjects/Mailer/ChangeLog +++ b/SOGo/SoObjects/Mailer/ChangeLog @@ -1,5 +1,8 @@ 2005-07-14 Helge Hess + * SOGoSharedMailAccount.m: prepared code to support a shared INBOX + folder (v0.9.101) + * v0.9.100 * SOGoMailAccounts.m: create an object of class SOGoSharedMailAccount @@ -9,7 +12,7 @@ mail accounts * added SOGoSharedMailAccount class for shared mailboxes - + 2005-07-12 Helge Hess * SOGoMailAccounts.m: use new SoUser API instead of AgenorUserManager diff --git a/SOGo/SoObjects/Mailer/SOGoSharedMailAccount.m b/SOGo/SoObjects/Mailer/SOGoSharedMailAccount.m index 7c264855..eb509f7f 100644 --- a/SOGo/SoObjects/Mailer/SOGoSharedMailAccount.m +++ b/SOGo/SoObjects/Mailer/SOGoSharedMailAccount.m @@ -63,13 +63,18 @@ static NSString *otherUsersFolderName = @""; // TODO: add English default /* listing the available folders */ - (NSArray *)toManyRelationshipKeys { - NSArray *a, *b; + NSMutableArray *m; + NSArray *b; - a = [self additionalRootFolderNames]; - // TODO: we also need to add the INBOX here (the 'real' INBOX is the root) + m = [NSMutableArray arrayWithCapacity:16]; - b = [[self imap4Connection] subfoldersForURL:[self imap4URL]]; - return [b count] > 0 ? [b arrayByAddingObjectsFromArray:a] : a; + [m addObject:@"INBOX"]; /* special for shared, see -lookupInboxFolder:.. */ + + if ((b = [[self imap4Connection] subfoldersForURL:[self imap4URL]]) != nil) + [m addObjectsFromArray:b]; + + [m addObjectsFromArray:[self additionalRootFolderNames]]; + return m; } /* IMAP4 locator */ @@ -85,4 +90,32 @@ static NSString *otherUsersFolderName = @""; // TODO: add English default return s; } +/* lookup */ + +- (id)lookupInboxFolder:(NSString *)_key inContext:(id)_ctx { + /* + Note: We have a choice: Cyrus does both, it gives the user an own + INBOX folder, but it also provides access to the mailbox INBOX + folder. + However the mailbox INBOX folder is NOT returned as an "INBOX" + subcollection as usual, but is the primary mailbox name. + Eg: + 2 list "*" "*" + * LIST (\Noinferiors) "/" "INBOX" + * LIST (\HasChildren) "/" "Boite partag&AOk-e/alienor.a" + + 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; +} + +- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag { + if ([_key isEqualToString:@"INBOX"]) + return [self lookupInboxFolder:_key inContext:_ctx]; + + return [super lookupName:_key inContext:_ctx acquire:_flag]; +} + @end /* SOGoSharedMailAccount */ diff --git a/SOGo/SoObjects/Mailer/Version b/SOGo/SoObjects/Mailer/Version index 4b71515e..57886007 100644 --- a/SOGo/SoObjects/Mailer/Version +++ b/SOGo/SoObjects/Mailer/Version @@ -1,6 +1,6 @@ # Version file -SUBMINOR_VERSION:=100 +SUBMINOR_VERSION:=101 # v0.9.96 requires libNGMime v4.5.223 # v0.9.91 requires libNGMime v4.5.222 diff --git a/SOGo/UI/MailerUI/ChangeLog b/SOGo/UI/MailerUI/ChangeLog index afe4b66a..4dcd5af9 100644 --- a/SOGo/UI/MailerUI/ChangeLog +++ b/SOGo/UI/MailerUI/ChangeLog @@ -1,3 +1,9 @@ +2005-07-14 Helge Hess + + * UIxMailAccountView.m: removed methods to detect whether the + clientObject is a shared account (done by the clientObject itself) + (v0.9.140) + 2005-07-12 Helge Hess * UIxMailEditor.m: perform some validation plus error handling prior diff --git a/SOGo/UI/MailerUI/UIxMailAccountView.m b/SOGo/UI/MailerUI/UIxMailAccountView.m index d4840521..8042d15a 100644 --- a/SOGo/UI/MailerUI/UIxMailAccountView.m +++ b/SOGo/UI/MailerUI/UIxMailAccountView.m @@ -43,26 +43,6 @@ return [[[self clientObject] nameInContainer] titleForSOGoIMAP4String]; } -- (BOOL)isShareAccount { - return [[[self clientObject] nameInContainer] rangeOfString:@".-."].length >0 - ? YES : NO; -} - -- (NSString *)fullSharePath { - NSRange r; - NSString *s; - - s = [[self clientObject] nameInContainer]; - r = [s rangeOfString:@".-."]; - if (r.length == 0) return nil; - - s = [s substringFromIndex:(r.location + r.length)]; - r = [s rangeOfString:@"@"]; - if (r.length == 0) return s; - - return [s substringToIndex:r.location]; -} - - (NSString *)panelTitle { NSString *s; diff --git a/SOGo/UI/MailerUI/Version b/SOGo/UI/MailerUI/Version index 72fcdb5c..ce465e60 100644 --- a/SOGo/UI/MailerUI/Version +++ b/SOGo/UI/MailerUI/Version @@ -1,7 +1,8 @@ # version file -SUBMINOR_VERSION:=139 +SUBMINOR_VERSION:=140 +# v0.9.140 requires SoObjects/Mailer v0.9.100 # v0.9.134 requires libSOGo v0.9.41 # v0.9.100 requires libNGMime v4.5.213 # v0.9.99 requires libNGMime v4.5.212 diff --git a/SOGo/UI/Templates/ChangeLog b/SOGo/UI/Templates/ChangeLog index 031e1d9e..2562ebf1 100644 --- a/SOGo/UI/Templates/ChangeLog +++ b/SOGo/UI/Templates/ChangeLog @@ -1,3 +1,8 @@ +2005-07-14 Helge Hess + + * UIxMailAccountView.wox: directly access the clientObject to get share + information + 2005-07-14 Marcus Mueller * UIxCalSelectTab.wox: removed 'Schedule' tab. diff --git a/SOGo/UI/Templates/UIxMailAccountView.wox b/SOGo/UI/Templates/UIxMailAccountView.wox index 17c4de91..54806a62 100644 --- a/SOGo/UI/Templates/UIxMailAccountView.wox +++ b/SOGo/UI/Templates/UIxMailAccountView.wox @@ -10,10 +10,10 @@ title="panelTitle" >
- + - + @@ -25,17 +25,17 @@
SOGo Mail - - +

- +
- +