diff --git a/ChangeLog b/ChangeLog index ec36a0173..109ef9736 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-11-20 Wolfgang Sourdeau + + * OpenChange/MAPIStoreContext.m + (-initFromURL:withConnectionInfo:andTDBIndexing:): instantiate a + SOGoUser corresponding to the username of the new context and + associated it to the woContext ivar. + 2011-11-18 Wolfgang Sourdeau * OpenChange/MAPIStoreFolder.m (-permissionEntries): new public diff --git a/OpenChange/MAPIStoreContext.m b/OpenChange/MAPIStoreContext.m index ec431228c..997eafc07 100644 --- a/OpenChange/MAPIStoreContext.m +++ b/OpenChange/MAPIStoreContext.m @@ -208,11 +208,17 @@ _prepareContextClass (Class contextClass, andTDBIndexing: (struct tdb_wrap *) indexingTdb { NSString *username; + SOGoUser *activeUser; if ((self = [self init])) { ASSIGN (contextUrl, newUrl); username = [NSString stringWithUTF8String: newConnInfo->username]; + activeUser = [SOGoUser userWithLogin: username]; + if (!activeUser) + [self errorWithFormat: @"user '%@' not found in SOGo environment", + username]; + [woContext setActiveUser: activeUser]; ASSIGN (mapping, [MAPIStoreMapping mappingForUsername: username withIndexing: indexingTdb]); [mapping increaseUseCount];