From 13eab744771577a954e2d9b956c63bfb3f892e19 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 9 Mar 2012 02:07:31 +0000 Subject: [PATCH] Monotone-Parent: 4ea252c6500eb31c2c96a411c6338ecc5e71eef0 Monotone-Revision: abafefa4d1fdf7e9a4cc6b7d33dfe22f822d54d3 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-03-09T02:07:31 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ OpenChange/MAPIStoreContext.m | 14 +++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) 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; }