diff --git a/ChangeLog b/ChangeLog index 340fa6e9e..ac7d9e482 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2011-05-31 Wolfgang Sourdeau + * OpenChange/MAPIStoreSOGo.m (sogo_create_context): a new struct + mapistore_connection_info * is now passed as parameter, which + contains useful data about the current connection. + * OpenChange/MAPIStoreTable.m: (-deactivate): removed obsolete method, which was part of a hack anyway. diff --git a/OpenChange/MAPIStoreContext.h b/OpenChange/MAPIStoreContext.h index bd0296071..5c799e9fb 100644 --- a/OpenChange/MAPIStoreContext.h +++ b/OpenChange/MAPIStoreContext.h @@ -48,6 +48,7 @@ @interface MAPIStoreContext : NSObject { struct mapistore_context *memCtx; + struct mapistore_connection_info *connInfo; NSURL *contextUrl; uint64_t contextFid; @@ -62,17 +63,20 @@ } + (id) contextFromURI: (const char *) newUri + withConnectionInfo: (struct mapistore_connection_info *) newConnInfo andFID: (uint64_t) fid inMemCtx: (struct mapistore_context *) newMemCtx; -- (id) initFromURL: (NSURL *) newUri - andFID: (uint64_t) fid - inMemCtx: (struct mapistore_context *) newMemCtx; +- (id) initFromURL: (NSURL *) newUri + withConnectionInfo: (struct mapistore_connection_info *) newConnInfo + andFID: (uint64_t) fid + inMemCtx: (struct mapistore_context *) newMemCtx; - (void) setAuthenticator: (MAPIStoreAuthenticator *) newAuthenticator; - (MAPIStoreAuthenticator *) authenticator; - (NSURL *) url; +- (struct mapistore_connection_info *) connectionInfo; - (WOContext *) woContext; diff --git a/OpenChange/MAPIStoreContext.m b/OpenChange/MAPIStoreContext.m index 9d942ed3e..a6d850a15 100644 --- a/OpenChange/MAPIStoreContext.m +++ b/OpenChange/MAPIStoreContext.m @@ -108,6 +108,7 @@ static void *ldbCtx = NULL; static inline MAPIStoreContext * _prepareContextClass (struct mapistore_context *newMemCtx, Class contextClass, + struct mapistore_connection_info *connInfo, NSURL *url, uint64_t fid) { static NSMutableDictionary *registration = nil; @@ -121,7 +122,9 @@ _prepareContextClass (struct mapistore_context *newMemCtx, [registration setObject: [NSNull null] forKey: contextClass]; - context = [[contextClass alloc] initFromURL: url andFID: fid + context = [[contextClass alloc] initFromURL: url + withConnectionInfo: connInfo + andFID: fid inMemCtx: newMemCtx]; [context autorelease]; @@ -139,6 +142,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx, } + (id) contextFromURI: (const char *) newUri + withConnectionInfo: (struct mapistore_connection_info *) connInfo andFID: (uint64_t) fid inMemCtx: (struct mapistore_context *) newMemCtx { @@ -167,6 +171,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx, if (contextClass) context = _prepareContextClass (newMemCtx, contextClass, + connInfo, baseURL, fid); else @@ -198,9 +203,10 @@ _prepareContextClass (struct mapistore_context *newMemCtx, return self; } -- (id) initFromURL: (NSURL *) newUrl - andFID: (uint64_t) newFid - inMemCtx: (struct mapistore_context *) newMemCtx +- (id) initFromURL: (NSURL *) newUrl + withConnectionInfo: (struct mapistore_connection_info *) newConnInfo + andFID: (uint64_t) newFid + inMemCtx: (struct mapistore_context *) newMemCtx { struct loadparm_context *lpCtx; MAPIStoreMapping *mapping; @@ -222,6 +228,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx, contextFid = newFid; memCtx = newMemCtx; + connInfo = newConnInfo; } return self; @@ -262,6 +269,11 @@ _prepareContextClass (struct mapistore_context *newMemCtx, return contextUrl; } +- (struct mapistore_connection_info *) connectionInfo +{ + return connInfo; +} + - (void) setupRequest { NSMutableDictionary *info; diff --git a/OpenChange/MAPIStoreSOGo.m b/OpenChange/MAPIStoreSOGo.m index e9c74d65c..bb5d448cc 100644 --- a/OpenChange/MAPIStoreSOGo.m +++ b/OpenChange/MAPIStoreSOGo.m @@ -97,7 +97,9 @@ sogo_init (void) */ static int -sogo_create_context(TALLOC_CTX *mem_ctx, const char *uri, uint64_t fid, +sogo_create_context(TALLOC_CTX *mem_ctx, + struct mapistore_connection_info *conn_info, + const char *uri, uint64_t fid, void **private_data) { NSAutoreleasePool *pool; @@ -113,7 +115,9 @@ sogo_create_context(TALLOC_CTX *mem_ctx, const char *uri, uint64_t fid, MAPIStoreContextK = NSClassFromString (@"MAPIStoreContext"); if (MAPIStoreContextK) { - context = [MAPIStoreContextK contextFromURI: uri andFID: fid + context = [MAPIStoreContextK contextFromURI: uri + withConnectionInfo: conn_info + andFID: fid inMemCtx: mem_ctx]; [context retain];