From 33ad6cd48b53c04e543503be54806188de917335 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 29 Jul 2011 02:11:52 +0000 Subject: [PATCH] Monotone-Parent: 6b4e2f16b2a1ac3bbbb8f854763b7deb70bd8a46 Monotone-Revision: b82c98742f6f58a7217e5b601c74d10f86e4ab18 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-29T02:11:52 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ SoObjects/Mailer/SOGoMailFolder.h | 3 +++ SoObjects/Mailer/SOGoMailFolder.m | 29 +++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3898f89e0..2e259b6d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-07-28 Wolfgang Sourdeau + + * SoObjects/Mailer/SOGoMailFolder.m (-statusForFlags:): new method + that returns the values of flags passed as parameters. + (-fetchUIDsOfVanishedItems:): new method that returns the list of + UID that are reported to have vanished since the specified modseq. + 2011-07-27 Wolfgang Sourdeau * OpenChange/MAPIStoreGCSMessageTable.m diff --git a/SoObjects/Mailer/SOGoMailFolder.h b/SoObjects/Mailer/SOGoMailFolder.h index dd5603b37..4fb2cac76 100644 --- a/SoObjects/Mailer/SOGoMailFolder.h +++ b/SoObjects/Mailer/SOGoMailFolder.h @@ -52,6 +52,8 @@ - (NSArray *) toOneRelationshipKeys; - (NSArray *) toManyRelationshipKeys; +- (NSDictionary *) statusForFlags: (NSArray *) flags; + - (NSException *) deleteUIDs: (NSArray *) uids useTrashFolder: (BOOL *) withTrash inContext: (id) context; @@ -63,6 +65,7 @@ - (NSArray *) fetchUIDsMatchingQualifier: (id) _q sortOrdering: (id) _so; - (NSArray *) fetchUIDsMatchingQualifier: (id) _q sortOrdering: (id) _so threaded: (BOOL) _threaded; - (NSArray *) fetchUIDs: (NSArray *) _uids parts: (NSArray *) _parts; +- (NSArray *) fetchUIDsOfVanishedItems: (uint64_t) modseq; - (WOResponse *) copyUIDs: (NSArray *) uids toFolder: (NSString *) destinationFolder diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index 5dbcc9bf3..5dd8568f3 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -555,6 +555,24 @@ static NSString *defaultUserID = @"anyone"; return result; } +- (NSDictionary *) statusForFlags: (NSArray *) flags +{ + NGImap4Client *client; + NSString *folderName; + NSDictionary *result, *status; + + client = [[self imap4Connection] client]; + folderName = [[self imap4Connection] imap4FolderNameForURL: [self imap4URL]]; + result = [client status: folderName flags: flags]; + if ([[result objectForKey: @"result"] boolValue]) + status = [[[result objectForKey: @"RawResponse"] objectForKey: @"status"] + objectForKey: @"flags"]; + else + status = nil; + + return status; +} + - (NSArray *) fetchUIDsMatchingQualifier: (id) _q sortOrdering: (id) _so { @@ -588,6 +606,17 @@ static NSString *defaultUserID = @"anyone"; parts: _parts]; } +- (NSArray *) fetchUIDsOfVanishedItems: (uint64_t) modseq +{ + NGImap4Client *client; + NSDictionary *result; + + client = [[self imap4Connection] client]; + result = [client fetchVanished: modseq]; + + return [result objectForKey: @"vanished"]; +} + - (NSException *) postData: (NSData *) _data flags: (id) _flags {