Merge pull request #201 from zentyal/ejhernandez/sync-expunged-msgs-first-sync

oc-mail: Sync expunged messages on first cache sync
This commit is contained in:
Jesús García Sáez 2015-10-26 19:37:01 +01:00
commit c8d05d41a5

View file

@ -594,8 +594,7 @@ _compareFetchResultsByMODSEQ (id entry1, id entry2, void *data)
{ {
BOOL rc = YES; BOOL rc = YES;
uint64_t newChangeNum; uint64_t newChangeNum;
NSNumber *ti, *modseq, *initialLastModseq, *lastModseq, NSNumber *ti, *modseq, *lastModseq, *nextModseq;
*nextModseq;
NSString *changeNumber, *uid, *messageKey; NSString *changeNumber, *uid, *messageKey;
uint64_t lastModseqNbr; uint64_t lastModseqNbr;
EOQualifier *searchQualifier; EOQualifier *searchQualifier;
@ -634,7 +633,6 @@ _compareFetchResultsByMODSEQ (id entry1, id entry2, void *data)
} }
lastModseq = [currentProperties objectForKey: @"SyncLastModseq"]; lastModseq = [currentProperties objectForKey: @"SyncLastModseq"];
initialLastModseq = lastModseq;
if (lastModseq) if (lastModseq)
{ {
lastModseqNbr = [lastModseq unsignedLongLongValue]; lastModseqNbr = [lastModseq unsignedLongLongValue];
@ -718,8 +716,6 @@ _compareFetchResultsByMODSEQ (id entry1, id entry2, void *data)
} }
/* 2. we synchronise expunged UIDs */ /* 2. we synchronise expunged UIDs */
if (initialLastModseq)
{
fetchResults = [(SOGoMailFolder *) sogoObject fetchResults = [(SOGoMailFolder *) sogoObject
fetchUIDsOfVanishedItems: lastModseqNbr]; fetchUIDsOfVanishedItems: lastModseqNbr];
@ -751,7 +747,6 @@ _compareFetchResultsByMODSEQ (id entry1, id entry2, void *data)
[mapping setObject: lastModseq forKey: changeNumber]; [mapping setObject: lastModseq forKey: changeNumber];
foundChange = YES; foundChange = YES;
} }
}
if (foundChange) if (foundChange)
{ {