diff --git a/ActiveSync/SOGoActiveSyncDispatcher.m b/ActiveSync/SOGoActiveSyncDispatcher.m index 9c3b0a3ee..795791612 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher.m +++ b/ActiveSync/SOGoActiveSyncDispatcher.m @@ -1166,27 +1166,16 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // if (folderType == ActiveSyncMailFolder) { - EOQualifier *notDeletedQualifier, *sinceDateQualifier; - EOAndQualifier *qualifier; NSCalendarDate *filter; - NSArray *uids; + NSString *syncKey; + NSArray *allMessages; filter = [NSCalendarDate dateFromFilterType: [[(id)[[allCollections objectAtIndex: j] getElementsByTagName: @"FilterType"] lastObject] textValue]]; + syncKey = [[(id)[[allCollections objectAtIndex: j] getElementsByTagName: @"SyncKey"] lastObject] textValue]; - notDeletedQualifier = [EOQualifier qualifierWithQualifierFormat: - @"(not (flags = %@))", - @"deleted"]; - sinceDateQualifier = [EOQualifier qualifierWithQualifierFormat: - @"(DATE >= %@)", filter]; - - qualifier = [[EOAndQualifier alloc] initWithQualifiers: notDeletedQualifier, sinceDateQualifier, - nil]; - AUTORELEASE(qualifier); + allMessages = [currentCollection syncTokenFieldsWithProperties: nil matchingSyncToken: syncKey fromDate: filter]; - uids = [currentCollection fetchUIDsMatchingQualifier: qualifier - sortOrdering: @"REVERSE ARRIVAL" - threaded: NO]; - count = [uids count]; + count = [allMessages count]; // Add the number of UIDs expected to "soft delete" count += [self _softDeleteCountWithFilter: filter collectionId: nameInCache]; diff --git a/NEWS b/NEWS index 322216415..f3a161d57 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,7 @@ Bug fixes - fixed Language-Region tags in Web interface (#3121) - properly fallback over EAS to UTF-8 and then Latin1 for messages w/o charset (#3103) - prevent potential freebusy lookup crashes during timezone changes with repetitive events + - improved GetItemEstimate to count all vasnished/deleted mails too 2.2.16 (2015-02-12) -------------------