Monotone-Parent: c852be1d5a70f9aa1ee5a5b4e45b30bd3ef86939

Monotone-Revision: 1ed44d9759e8a5f57b9c55905872081bf8fec785

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-06-03T23:53:30
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2011-06-03 23:53:30 +00:00
parent 8672091178
commit 3b0b350ff3
8 changed files with 80 additions and 77 deletions

View File

@@ -70,8 +70,8 @@
static Class NSDataK, NSStringK, MAPIStoreFAIMessageK;
static MAPIStoreMapping *mapping;
static NSMutableDictionary *contextClassMapping;
static NSMutableDictionary *userMAPIStoreMapping;
static void *ldbCtx = NULL;
@@ -86,8 +86,6 @@ static void *ldbCtx = NULL;
NSStringK = [NSString class];
MAPIStoreFAIMessageK = [MAPIStoreFAIMessage class];
mapping = [MAPIStoreMapping sharedMapping];
contextClassMapping = [NSMutableDictionary new];
classes = GSObjCAllSubclassesOfClass (self);
max = [classes count];
@@ -103,6 +101,8 @@ static void *ldbCtx = NULL;
NSStringFromClass (currentClass), moduleName);
}
}
userMAPIStoreMapping = [NSMutableDictionary new];
}
static inline MAPIStoreContext *
@@ -209,7 +209,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
inMemCtx: (struct mapistore_context *) newMemCtx
{
struct loadparm_context *lpCtx;
MAPIStoreMapping *mapping;
NSString *username;
if ((self = [self init]))
{
@@ -221,7 +221,15 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
ASSIGN (contextUrl, newUrl);
mapping = [MAPIStoreMapping sharedMapping];
username = [NSString stringWithUTF8String: newConnInfo->username];
mapping = [userMAPIStoreMapping objectForKey: username];
if (!mapping)
{
[self logWithFormat: @"generating mapping of ids for user '%@'",
username];
mapping = [MAPIStoreMapping mappingWithIndexing: newConnInfo->indexing];
[userMAPIStoreMapping setObject: mapping forKey: username];
}
if (![mapping urlFromID: newFid])
[mapping registerURL: [newUrl absoluteString]
withID: newFid];
@@ -254,6 +262,11 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
return woContext;
}
- (MAPIStoreMapping *) mapping
{
return mapping;
}
- (void) setAuthenticator: (MAPIStoreAuthenticator *) newAuthenticator
{
ASSIGN (authenticator, newAuthenticator);
@@ -1332,8 +1345,6 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
uint64_t mappingId;
uint32_t contextId;
mapping = [MAPIStoreMapping sharedMapping];
if (key)
childURL = [NSString stringWithFormat: @"%@%@", folderURL, key];
else