Monotone-Parent: ea1c783b905b07e028051a8a9d8f7bf4c894b0f2
Monotone-Revision: 52d4d51e45d656f36fb470bd76ffe251fdc37b9c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-05-31T05:01:43 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
a5440bd52d
commit
29056ba07d
|
@ -1,5 +1,9 @@
|
|||
2011-05-31 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* 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.
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
Loading…
Reference in New Issue