Monotone-Parent: 34674c4b324f4c4e34c785d128cd8d8916743871

Monotone-Revision: 204093991ba2b93a87ca4679f958553358ef7abe

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-10-09T17:50:47
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2011-10-09 17:50:47 +00:00
parent 286b4429be
commit 64d8402fe2
2 changed files with 26 additions and 34 deletions

View File

@ -1,9 +1,3 @@
2011-10-07 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreMailFolder.m (-synchroniseCache)
(-getDeletedKeysFromChangeNumber:andCN:inTableType:): attempt to
fix the leak of version numbers.
2011-10-07 Francis Lachapelle <flachapelle@inverse.ca>
* UI/WebServerResources/UIxPreferences.js

View File

@ -469,8 +469,7 @@ _compareFetchResultsByMODSEQ (id entry1, id entry2, void *data)
{
BOOL rc = YES;
uint64_t newChangeNum;
NSNumber *ti, *changeNumber, *modseq, *lastModseq, *nextModseq,
*lastDeletedModseq, *uid;
NSNumber *ti, *changeNumber, *modseq, *lastModseq, *nextModseq, *uid;
uint64_t lastModseqNbr;
EOQualifier *searchQualifier;
NSArray *uids;
@ -567,22 +566,16 @@ _compareFetchResultsByMODSEQ (id entry1, id entry2, void *data)
ldb_transaction_commit([[self context] connectionInfo]->oc_ctx);
foundChange = YES;
[currentProperties setObject: lastModseq forKey: @"SyncLastModseq"];
}
lastDeletedModseq
= [currentProperties objectForKey: @"SyncLastDeletedModseq"];
if (lastDeletedModseq)
if (lastModseq)
{
lastModseqNbr = [lastDeletedModseq unsignedLongLongValue];
uids = [(SOGoMailFolder *) sogoObject
fetchUIDsOfVanishedItems: lastModseqNbr];
if ([uids count] > 0)
{
foundChange = YES;
[currentProperties setObject: uids
forKey: @"SyncLastDeletedUIDs"];
}
/* FIXME: the problem here is that if a delete is the last operation
performed on a folder, the SyncLastSynchronisationDate will continuously
get updated until a new modseq shows up */
foundChange |= [[(SOGoMailFolder *) sogoObject
fetchUIDsOfVanishedItems: lastModseqNbr]
count] > 0;
}
if (foundChange)
@ -590,6 +583,7 @@ _compareFetchResultsByMODSEQ (id entry1, id entry2, void *data)
ti = [NSNumber numberWithDouble: [now timeIntervalSince1970]];
[currentProperties setObject: ti
forKey: @"SyncLastSynchronisationDate"];
[currentProperties setObject: lastModseq forKey: @"SyncLastModseq"];
[versionsMessage appendProperties: currentProperties];
[versionsMessage save];
}
@ -732,7 +726,8 @@ _compareFetchResultsByMODSEQ (id entry1, id entry2, void *data)
NSArray *deletedKeys, *deletedUIDs;
NSNumber *changeNumNbr;
uint64_t modseq;
NSMutableDictionary *currentProperties, *messages;
NSDictionary *versionProperties; // , *status;
NSMutableDictionary *messages, *mapping;
NSNumber *newChangeNumNbr; // , *highestModseq;
uint64_t newChangeNum;
NSUInteger count, max;
@ -744,25 +739,28 @@ _compareFetchResultsByMODSEQ (id entry1, id entry2, void *data)
unsignedLongLongValue];
if (modseq > 0)
{
currentProperties = [[versionsMessage properties] mutableCopy];
deletedUIDs = [currentProperties objectForKey: @"SyncLastDeletedUIDs"];
if ([deletedUIDs count] > 0)
// status
// = [sogoObject
// statusForFlags: [NSArray arrayWithObject: @"HIGHESTMODSEQ"]];
// highestModseq = [status objectForKey: @"highestmodseq"];
versionProperties = [versionsMessage properties];
messages = [versionProperties objectForKey: @"Messages"];
deletedUIDs = [(SOGoMailFolder *) sogoObject
fetchUIDsOfVanishedItems: modseq];
deletedKeys = [deletedUIDs stringsWithFormat: @"%@.eml"];
max = [deletedUIDs count];
if (max > 0)
{
[currentProperties removeObjectForKey: @"SyncLastDeletedUIDs"];
[currentProperties setObject: changeNumNbr
forKey: @"SyncLastDeletedModseq"];
messages = [currentProperties objectForKey: @"Messages"];
[messages removeObjectsForKeys: deletedUIDs];
[versionsMessage appendProperties: currentProperties];
[versionsMessage save];
deletedKeys = [deletedUIDs stringsWithFormat: @"%@.eml"];
max = [deletedKeys count];
mapping = [versionProperties objectForKey: @"VersionsMapping"];
for (count = 0; count < max; count++)
newChangeNum = [[self context] getNewChangeNumber];
newChangeNumNbr = [NSNumber numberWithUnsignedLongLong: newChangeNum];
*cnNbr = newChangeNumNbr;
[mapping setObject: newChangeNumNbr forKey: @"SyncLastModseq"];
[versionsMessage save];
}
}
else