mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-14 11:23:19 +00:00
Added method to get synctag starting from an other one.
We also no longer fetch vanished items of modseq == 0
This commit is contained in:
@@ -94,6 +94,7 @@
|
||||
|
||||
- (NSCalendarDate *) mostRecentMessageDate;
|
||||
|
||||
- (NSString *) davCollectionTagFromId: (NSString *) theId;
|
||||
- (NSString *) davCollectionTag;
|
||||
|
||||
- (NSArray *) syncTokenFieldsWithProperties: (NSDictionary *) properties
|
||||
|
||||
@@ -1925,6 +1925,27 @@ static NSString *defaultUserID = @"anyone";
|
||||
return date;
|
||||
}
|
||||
|
||||
- (NSString *) davCollectionTagFromId: (NSString *) theId
|
||||
{
|
||||
NSString *tag;
|
||||
|
||||
tag = @"-1";
|
||||
|
||||
if ([self imap4Connection])
|
||||
{
|
||||
NSDictionary *result;
|
||||
unsigned int modseq, uid;
|
||||
|
||||
uid = [theId intValue];
|
||||
result = [[imap4 client] fetchModseqForUid: uid];
|
||||
modseq = [[[[result objectForKey: @"RawResponse"] objectForKey: @"fetch"] objectForKey: @"modseq"] intValue];
|
||||
|
||||
tag = [NSString stringWithFormat: @"%d-%d", uid, modseq-1];
|
||||
}
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
- (NSString *) davCollectionTag
|
||||
{
|
||||
NSString *tag;
|
||||
@@ -1976,10 +1997,14 @@ static NSString *defaultUserID = @"anyone";
|
||||
//
|
||||
// Check updated items
|
||||
//
|
||||
//
|
||||
//
|
||||
// . uid fetch 1:* (FLAGS) (changedsince 171)
|
||||
//
|
||||
// To get the modseq of a specific message:
|
||||
//
|
||||
// . uid fetch 124569:124569 uid (changedsince 1)
|
||||
//
|
||||
//
|
||||
// Deleted: "UID FETCH 1:* (UID) (CHANGEDSINCE 171 VANISHED)"
|
||||
|
||||
// fetchUIDsOfVanishedItems ..
|
||||
@@ -2073,12 +2098,15 @@ static NSString *defaultUserID = @"anyone";
|
||||
|
||||
|
||||
// We fetch deleted ones
|
||||
uids = [self fetchUIDsOfVanishedItems: highestmodseq];
|
||||
|
||||
for (i = 0; i < [uids count]; i++)
|
||||
if (highestmodseq > 0)
|
||||
{
|
||||
d = [NSDictionary dictionaryWithObject: @"deleted" forKey: [uids objectAtIndex: i]];
|
||||
[allTokens addObject: d];
|
||||
uids = [self fetchUIDsOfVanishedItems: highestmodseq];
|
||||
|
||||
for (i = 0; i < [uids count]; i++)
|
||||
{
|
||||
d = [NSDictionary dictionaryWithObject: @"deleted" forKey: [uids objectAtIndex: i]];
|
||||
[allTokens addObject: d];
|
||||
}
|
||||
}
|
||||
|
||||
return allTokens;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user