diff --git a/OpenChange/MAPIStoreContext.m b/OpenChange/MAPIStoreContext.m index 62d80c6e4..2ee8cd026 100644 --- a/OpenChange/MAPIStoreContext.m +++ b/OpenChange/MAPIStoreContext.m @@ -108,13 +108,12 @@ static NSMutableDictionary *contextClassMapping; NSArray *classes; Class currentClass; NSUInteger count, max; - MAPIStoreUserContext *userContext; list = NULL; - userContext = [MAPIStoreUserContext userContextWithUsername: userName - andTDBIndexing: indexing]; - [userContext activate]; + // User context is activated on initialization + [MAPIStoreUserContext userContextWithUsername: userName + andTDBIndexing: indexing]; classes = GSObjCAllSubclassesOfClass (self); max = [classes count]; diff --git a/OpenChange/MAPIStoreGCSBaseContext.m b/OpenChange/MAPIStoreGCSBaseContext.m index e2de733b0..e0f06482d 100644 --- a/OpenChange/MAPIStoreGCSBaseContext.m +++ b/OpenChange/MAPIStoreGCSBaseContext.m @@ -121,7 +121,6 @@ userContext = [MAPIStoreUserContext userContextWithUsername: userName andTDBIndexing: NULL]; - [userContext activate]; moduleName = [self MAPIModuleName]; parentFolder = [[userContext rootFolders] objectForKey: moduleName]; nameInContainer = nil; diff --git a/OpenChange/MAPIStoreMailContext.m b/OpenChange/MAPIStoreMailContext.m index 7d3e3592c..7ec79ad50 100644 --- a/OpenChange/MAPIStoreMailContext.m +++ b/OpenChange/MAPIStoreMailContext.m @@ -198,7 +198,6 @@ MakeDisplayFolderName (NSString *folderName) userContext = [MAPIStoreUserContext userContextWithUsername: userName andTDBIndexing: NULL]; - [userContext activate]; accountFolder = [[userContext rootFolders] objectForKey: @"mail"]; folderName = [NSString stringWithFormat: @"folder%@", [newFolderName asCSSIdentifier]]; diff --git a/OpenChange/MAPIStoreUserContext.m b/OpenChange/MAPIStoreUserContext.m index cf3fe46fe..d0ffbee66 100644 --- a/OpenChange/MAPIStoreUserContext.m +++ b/OpenChange/MAPIStoreUserContext.m @@ -159,6 +159,8 @@ static NSMapTable *contextsTable = nil; if ([userPassword length] == 0) userPassword = username; [authenticator setPassword: userPassword]; + // Activate the profile on initialization + [self activate]; } return self;