oc-mail: Manage multiple CN restriction

By ignoring <, =< and = operators and simplifying the following
request:

    MODSEQ >= x || MODSEQ >= y || MODSEQ >= z  --> MODSEQ >= min(x, y, z)

This hack will reduce the number of current retrieved UID keys
from the IMAP server. Current status is to retrieve everything when
the multiple CN restriction is sent as the required restriction
is too complex and it is not defined by the IMAP spec.

The proper implementation for:

    CN > x_1 & CN < x_2 | CN > y_1 & CN < y_2 | CN > z_1

It will be something like this:

    set(MODSEQ >= x_1 + 1) - set(MODSEQ >= x_2)
    U
    set(MODSEQ >= y_1 + 1) - set(MODSEQ >= y_2)
    U
    set(MODSEQ >= z_1)

Assuming x_1 <= x_2 <= y_1 <= y_2 <= z_1.
This commit is contained in:
Enrique J. Hernández Blasco
2015-12-11 11:22:26 +01:00
parent 10cabca57e
commit 98ed9c3b17
2 changed files with 67 additions and 4 deletions

View File

@@ -181,8 +181,8 @@ static Class MAPIStoreMailMessageK, NSDataK, NSStringK;
else
{
/* Ignore other operations as IMAP only support MODSEQ >= X */
[self warnWithFormat: @"Ignoring %@ as only supported operators are > and >=",
[self operatorFromRestrictionOperator: res->relop]];
[self warnWithFormat: @"Ignoring '%@' as only supported operators are > and >=",
NSStringFromSelector ([self operatorFromRestrictionOperator: res->relop])];
rc = MAPIRestrictionStateAlwaysTrue;
}
}