diff --git a/ChangeLog b/ChangeLog index e066bcfd0..494598d66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2011-08-08 Wolfgang Sourdeau + * OpenChange/MAPIStoreContext.m (-activeUser): new helper method. + * OpenChange/MAPIStoreSOGo.m (sogo_backend_init): invoke -activateApplication on the new app in order to make it accessible via [WOApplication application]. diff --git a/OpenChange/MAPIStoreContext.h b/OpenChange/MAPIStoreContext.h index 86a874952..94c35e811 100644 --- a/OpenChange/MAPIStoreContext.h +++ b/OpenChange/MAPIStoreContext.h @@ -41,6 +41,7 @@ @class SOGoFolder; @class SOGoMAPIFSFolder; @class SOGoObject; +@class SOGoUser; @class MAPIStoreAuthenticator; @class MAPIStoreAttachment; @@ -86,6 +87,8 @@ - (void) setupRequest; - (void) tearDownRequest; +- (SOGoUser *) activeUser; + // - (id) lookupObject: (NSString *) objectURLString; /* backend methods */ diff --git a/OpenChange/MAPIStoreContext.m b/OpenChange/MAPIStoreContext.m index 051aeb1a4..8472d8807 100644 --- a/OpenChange/MAPIStoreContext.m +++ b/OpenChange/MAPIStoreContext.m @@ -273,6 +273,22 @@ _prepareContextClass (Class contextClass, [MAPIApp setMAPIStoreContext: nil]; } +- (SOGoUser *) activeUser +{ + SOGoUser *activeUser; + NSString *userName; + + if (connInfo && connInfo->username) + { + userName = [NSString stringWithUTF8String: connInfo->username]; + activeUser = [SOGoUser userWithLogin: userName]; + } + else + activeUser = nil; + + return activeUser; +} + // - (void) logRestriction: (struct mapi_SRestriction *) res // withState: (MAPIRestrictionState) state // {