Create child folder objects using parent context for real
We activate the user for the context using the root folder context as there are times where the active user is not matching with the one stored in the application context and SOGo object is storing cached data with the wrong user leading to create folders in wrong mailboxes, etc. As this application is single-threaded, no problems are expected. Indeed, the same code is available at getting the root folder (ie INBOX).
This commit is contained in:
parent
ba79234ceb
commit
dba17fbcbc
|
@ -29,6 +29,7 @@
|
||||||
#import <Foundation/NSString.h>
|
#import <Foundation/NSString.h>
|
||||||
#import <Foundation/NSURL.h>
|
#import <Foundation/NSURL.h>
|
||||||
#import <NGExtensions/NSObject+Logs.h>
|
#import <NGExtensions/NSObject+Logs.h>
|
||||||
|
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||||
#import <SOGo/SOGoContentObject.h>
|
#import <SOGo/SOGoContentObject.h>
|
||||||
#import <SOGo/SOGoUser.h>
|
#import <SOGo/SOGoUser.h>
|
||||||
#import <SOGo/SOGoFolder.h>
|
#import <SOGo/SOGoFolder.h>
|
||||||
|
@ -235,6 +236,11 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
||||||
if ([[self folderKeys] containsObject: folderKey])
|
if ([[self folderKeys] containsObject: folderKey])
|
||||||
{
|
{
|
||||||
woContext = [[self userContext] woContext];
|
woContext = [[self userContext] woContext];
|
||||||
|
/* We activate the user for the context using the root folder
|
||||||
|
context as there are times where the active user is not
|
||||||
|
matching with the one stored in the application context
|
||||||
|
and SOGo object is storing cached data with the wrong user */
|
||||||
|
[[self userContext] activateWithUser: [woContext activeUser]];
|
||||||
sogoFolder = [sogoObject lookupName: folderKey inContext: woContext
|
sogoFolder = [sogoObject lookupName: folderKey inContext: woContext
|
||||||
acquire: NO];
|
acquire: NO];
|
||||||
if (sogoFolder && ![sogoFolder isKindOfClass: NSExceptionK])
|
if (sogoFolder && ![sogoFolder isKindOfClass: NSExceptionK])
|
||||||
|
|
Loading…
Reference in a new issue