mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-04 21:08:51 +00:00
oc: Enforce the folder creation mapping when the FID exists
We believe the folder ID OpenChange is sending us is new and we keep the indexing database properly updated. Although the solution is not elegant, this could avoid inconsistencies between what the client stores and the relation in the MAPIStore backend.
This commit is contained in:
@@ -227,12 +227,32 @@ MAPIStoreMappingKeyFromId (uint64_t idNbr)
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) updateURL: (NSString *) urlString
|
||||
withID: (uint64_t) idNbr
|
||||
{
|
||||
BOOL rc = NO;
|
||||
uint64_t oldIDNbr;
|
||||
|
||||
oldIDNbr = [self idFromURL: urlString];
|
||||
if (oldIDNbr)
|
||||
{
|
||||
[self logWithFormat: @"Updating URL: %@ with id %.16"PRIx64" from old id %.16"PRIx64,
|
||||
urlString, idNbr, oldIDNbr];
|
||||
[self unregisterURLWithID: oldIDNbr];
|
||||
[self registerURL: urlString
|
||||
withID: idNbr];
|
||||
rc = YES;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (BOOL) registerURL: (NSString *) urlString
|
||||
withID: (uint64_t) idNbr
|
||||
{
|
||||
NSString *oldURL;
|
||||
uint64_t oldIdNbr;
|
||||
bool rc, softDeleted;
|
||||
bool softDeleted;
|
||||
|
||||
oldURL = [self urlFromID: idNbr];
|
||||
if (oldURL != NULL)
|
||||
@@ -257,7 +277,6 @@ MAPIStoreMappingKeyFromId (uint64_t idNbr)
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = YES;
|
||||
// [self logWithFormat: @"registered url '%@' with id %lld (0x%.16"PRIx64")",
|
||||
// urlString, idNbr, idNbr];
|
||||
|
||||
@@ -266,7 +285,7 @@ MAPIStoreMappingKeyFromId (uint64_t idNbr)
|
||||
idNbr, [urlString UTF8String]);
|
||||
}
|
||||
|
||||
return rc;
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void) registerURLs: (NSArray *) urlStrings
|
||||
|
||||
Reference in New Issue
Block a user