diff --git a/ChangeLog b/ChangeLog index 185609f88..22aa07ae0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2012-03-08 Wolfgang Sourdeau + * OpenChange/MAPIStoreContext.m (-getRootFolder:inMemCtx:): do not + store the looked up folders when they are not descendants of + SOGoObject. Return MAPISTORE_ERR_NOT_FOUND when the looked up + folder is owner by the current user and MAPISTORE_ERR_DENIED + otherwise. + * OpenChange/MAPIStoreGCSFolder.m (-synchroniseCache): ensure that any record that are marked as updated are removed from the record cache of the corresponding SOGoGCSFolder instance. diff --git a/OpenChange/MAPIStoreContext.m b/OpenChange/MAPIStoreContext.m index 81da9d4c6..17907e93b 100644 --- a/OpenChange/MAPIStoreContext.m +++ b/OpenChange/MAPIStoreContext.m @@ -67,7 +67,7 @@ /* sogo://username:password@{contacts,calendar,tasks,journal,notes,mail}/dossier/id */ -static Class NSExceptionK, MAPIStoreFallbackContextK; +static Class NSExceptionK, MAPIStoreFallbackContextK, SOGoObjectK; static NSMutableDictionary *contextClassMapping; @@ -79,6 +79,7 @@ static NSMutableDictionary *contextClassMapping; NSString *moduleName; NSExceptionK = [NSException class]; + SOGoObjectK = [SOGoObject class]; contextClassMapping = [NSMutableDictionary new]; classes = GSObjCAllSubclassesOfClass (self); @@ -441,10 +442,11 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri) = [currentFolder lookupName: [pathComponents objectAtIndex: count] inContext: woContext acquire: NO]; - if ([currentFolder isKindOfClass: NSExceptionK]) - currentFolder = nil; - else + if ([currentFolder isKindOfClass: SOGoObjectK]) /* class common to all + SOGo folder types */ [containersBag addObject: currentFolder]; + else + currentFolder = nil; } if (currentFolder) @@ -457,8 +459,10 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri) *folderPtr = baseFolder; rc = MAPISTORE_SUCCESS; } - else + else if ([[userContext sogoUser] isEqual: activeUser]) rc = MAPISTORE_ERR_NOT_FOUND; + else + rc = MAPISTORE_ERR_DENIED; return rc; }