oc-db: Store version number instead of CN

To be able to search in this for every kind of operator.

As we cannot do a migration, we have to add a new key to the property
dictionary (@"version_number") which stores the version:

  version = exchange_globcnt(CN >> 16)

Instead of the CN structure which is stored in @"version" key.

This way we can do searches for CN to download only missing data from the
given state of the client for this kind of messages.
This commit is contained in:
Enrique J. Hernández Blasco
2015-12-11 11:38:21 +01:00
parent 5993fe97c3
commit a618386d5e
2 changed files with 27 additions and 11 deletions

View File

@@ -61,14 +61,15 @@ static Class MAPIStoreDBMessageK = Nil;
if ((uint32_t) res->ulPropTag == PidTagChangeNumber)
{
SEL operator;
value = NSObjectFromMAPISPropValue (&res->lpProp);
cVersion = exchange_globcnt (([value unsignedLongLongValue] >> 16)
& 0x0000ffffffffffffLL);
version = [NSNumber numberWithUnsignedLongLong: cVersion];
//[self logWithFormat: @"change number from oxcfxics: %.16lx", [value unsignedLongLongValue]];
[self logWithFormat: @" version: %.16lx", cVersion];
*qualifier = [[EOKeyValueQualifier alloc] initWithKey: @"version"
operatorSelector: EOQualifierOperatorGreaterThanOrEqualTo
operator = [self operatorFromRestrictionOperator: res->relop];
*qualifier = [[EOKeyValueQualifier alloc] initWithKey: @"version_number"
operatorSelector: operator
value: version];
[*qualifier autorelease];
rc = MAPIRestrictionStateNeedsEval;