From 65563a2067f1644022d20e2a15b89467dbb102ce Mon Sep 17 00:00:00 2001 From: helge Date: Thu, 14 Jul 2005 15:14:57 +0000 Subject: [PATCH] added ability to lookup some standard folders git-svn-id: http://svn.opengroupware.org/SOGo/trunk@758 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/SoObjects/Mailer/README | 7 ++++++ SOGo/SoObjects/SOGo/ChangeLog | 3 +++ SOGo/SoObjects/SOGo/SOGoFolder.h | 3 +++ SOGo/SoObjects/SOGo/SOGoUser.h | 4 ++++ SOGo/SoObjects/SOGo/SOGoUser.m | 40 ++++++++++++++++++++++++++++++++ SOGo/SoObjects/SOGo/Version | 2 +- 6 files changed, 58 insertions(+), 1 deletion(-) diff --git a/SOGo/SoObjects/Mailer/README b/SOGo/SoObjects/Mailer/README index bfccb5bb..440c0632 100644 --- a/SOGo/SoObjects/Mailer/README +++ b/SOGo/SoObjects/Mailer/README @@ -17,10 +17,12 @@ Class Hierarchy SOGoDraftObject SOGoDraftsFolder SOGoMailAccount + SOGoSharedMailAccount SOGoMailBodyPart SOGoImageMailBodyPart SOGoMessageMailBodyPart SOGoMailFolder + SOGoSharedInboxFolder SOGoMailObject SOGoMailConnectionEntry [EODataSource] @@ -39,3 +41,8 @@ SOGoNoDraftDeleteAfterSend YES|NO - makes the draft's -delete method a NOOP SOGoSpecialFoldersInRoot YES|NO - do special folders live under INBOX? - corresponds to the Cyrus setting: "altnamespace: yes" SOGoEnableSieveFolder YES|NO - should the Sieve folder be visible? + +SOGoSharedFolderName IMAP4-Name + - corresponds to the Cyrus setting: sharedprefix +SOGoOtherUsersFolderName IMAP4-Name + - corresponds to the Cyrus setting: userprefix diff --git a/SOGo/SoObjects/SOGo/ChangeLog b/SOGo/SoObjects/SOGo/ChangeLog index e992cfe4..123af1e1 100644 --- a/SOGo/SoObjects/SOGo/ChangeLog +++ b/SOGo/SoObjects/SOGo/ChangeLog @@ -1,5 +1,8 @@ 2005-07-14 Helge Hess + * SOGoUser.m: added -homeFolderInContext: and + -schedulingCalendarInContext: methods (v0.9.59) + * moved in SOGoUser and SOGoAuthenticator from Main (v0.9.58) 2005-07-14 Marcus Mueller diff --git a/SOGo/SoObjects/SOGo/SOGoFolder.h b/SOGo/SoObjects/SOGo/SOGoFolder.h index f64d8e11..3e79b2b6 100644 --- a/SOGo/SoObjects/SOGo/SOGoFolder.h +++ b/SOGo/SoObjects/SOGo/SOGoFolder.h @@ -32,6 +32,9 @@ A common superclass for folders stored in GCS. Already deals with all GCS folder specific things. + + Important: folders should NOT retain the context! Otherwise you might get + cyclic references. */ @interface SOGoFolder : SOGoObject diff --git a/SOGo/SoObjects/SOGo/SOGoUser.h b/SOGo/SoObjects/SOGo/SOGoUser.h index e4572479..9695e736 100644 --- a/SOGo/SoObjects/SOGo/SOGoUser.h +++ b/SOGo/SoObjects/SOGo/SOGoUser.h @@ -57,6 +57,10 @@ - (NSUserDefaults *)userDefaults; +/* folders */ + +- (id)schedulingCalendarInContext:(id)_ctx; + @end #endif /* __SOGoUser_H__ */ diff --git a/SOGo/SoObjects/SOGo/SOGoUser.m b/SOGo/SoObjects/SOGo/SOGoUser.m index 0eee0aef..463f26ee 100644 --- a/SOGo/SoObjects/SOGo/SOGoUser.m +++ b/SOGo/SoObjects/SOGo/SOGoUser.m @@ -82,4 +82,44 @@ return self->userDefaults; } +/* folders */ + +- (id)homeFolderInContext:(id)_ctx { + /* Note: watch out for cyclic references */ + // TODO: maybe we should add an [activeUser reset] method to SOPE + id folder; + + if ((folder = [_ctx objectForKey:@"ActiveUserHomeFolder"]) != nil) + return [folder isNotNull] ? folder : nil; + + folder = [[WOApplication application] lookupName:[self login] + inContext:_ctx acquire:NO]; + if ([folder isKindOfClass:[NSException class]]) + return folder; + + [_ctx setObject:folder ? folder : [NSNull null] + forKey:@"ActiveUserHomeFolder"]; + return folder; +} + +- (id)schedulingCalendarInContext:(id)_ctx { + /* Note: watch out for cyclic references */ + id folder; + + if ((folder = [_ctx objectForKey:@"ActiveUserCalendar"]) != nil) + return [folder isNotNull] ? folder : nil; + + folder = [self homeFolderInContext:_ctx]; + if ([folder isKindOfClass:[NSException class]]) + return folder; + + folder = [folder lookupName:@"Calendar" inContext:_ctx acquire:NO]; + if ([folder isKindOfClass:[NSException class]]) + return folder; + + [_ctx setObject:folder ? folder : [NSNull null] + forKey:@"ActiveUserCalendar"]; + return folder; +} + @end /* SOGoUser */ diff --git a/SOGo/SoObjects/SOGo/Version b/SOGo/SoObjects/SOGo/Version index 82e7cdef..8fefbc54 100644 --- a/SOGo/SoObjects/SOGo/Version +++ b/SOGo/SoObjects/SOGo/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=58 +SUBMINOR_VERSION:=59 # v0.9.50 requires libGDLContentStore v4.5.30 # v0.9.34 requires libGDLContentStore v4.5.26 -- 2.39.5