Monotone-Parent: 4ea252c6500eb31c2c96a411c6338ecc5e71eef0

Monotone-Revision: abafefa4d1fdf7e9a4cc6b7d33dfe22f822d54d3

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-03-09T02:07:31
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau 2012-03-09 02:07:31 +00:00
parent a29aa90913
commit 13eab74477
2 changed files with 15 additions and 5 deletions

View file

@ -1,5 +1,11 @@
2012-03-08 Wolfgang Sourdeau <wsourdeau@inverse.ca> 2012-03-08 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* 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 * OpenChange/MAPIStoreGCSFolder.m (-synchroniseCache): ensure that
any record that are marked as updated are removed from the record any record that are marked as updated are removed from the record
cache of the corresponding SOGoGCSFolder instance. cache of the corresponding SOGoGCSFolder instance.

View file

@ -67,7 +67,7 @@
/* sogo://username:password@{contacts,calendar,tasks,journal,notes,mail}/dossier/id */ /* sogo://username:password@{contacts,calendar,tasks,journal,notes,mail}/dossier/id */
static Class NSExceptionK, MAPIStoreFallbackContextK; static Class NSExceptionK, MAPIStoreFallbackContextK, SOGoObjectK;
static NSMutableDictionary *contextClassMapping; static NSMutableDictionary *contextClassMapping;
@ -79,6 +79,7 @@ static NSMutableDictionary *contextClassMapping;
NSString *moduleName; NSString *moduleName;
NSExceptionK = [NSException class]; NSExceptionK = [NSException class];
SOGoObjectK = [SOGoObject class];
contextClassMapping = [NSMutableDictionary new]; contextClassMapping = [NSMutableDictionary new];
classes = GSObjCAllSubclassesOfClass (self); classes = GSObjCAllSubclassesOfClass (self);
@ -441,10 +442,11 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
= [currentFolder lookupName: [pathComponents objectAtIndex: count] = [currentFolder lookupName: [pathComponents objectAtIndex: count]
inContext: woContext inContext: woContext
acquire: NO]; acquire: NO];
if ([currentFolder isKindOfClass: NSExceptionK]) if ([currentFolder isKindOfClass: SOGoObjectK]) /* class common to all
currentFolder = nil; SOGo folder types */
else
[containersBag addObject: currentFolder]; [containersBag addObject: currentFolder];
else
currentFolder = nil;
} }
if (currentFolder) if (currentFolder)
@ -457,8 +459,10 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
*folderPtr = baseFolder; *folderPtr = baseFolder;
rc = MAPISTORE_SUCCESS; rc = MAPISTORE_SUCCESS;
} }
else else if ([[userContext sogoUser] isEqual: activeUser])
rc = MAPISTORE_ERR_NOT_FOUND; rc = MAPISTORE_ERR_NOT_FOUND;
else
rc = MAPISTORE_ERR_DENIED;
return rc; return rc;
} }