oc: Search for properties in a SOGoMAPIDB object now works

sogo-openchange library stores the properties as NSString keys
and the search function casts the values to NSNumber, which it may
be valid for other parts but not for this library.

The real fix would be to store the property keys as NSNumbers as
they are uint32_t at the end. However, this may lead to a great
refactor in the library.

With this fix, we can match the search for a property in a
MAPIStoreFallback folder, such as Notes or Deleted Items, or
MAPIStoreFolder properties (ie: search for a subfolder) or
for MAPIStoreFAIMessages in a folder.
This commit is contained in:
Enrique J. Hernández Blasco
2015-04-13 11:37:48 +02:00
parent 479bbce7d0
commit fa23b574eb

View File

@@ -125,6 +125,11 @@ typedef BOOL (*EOComparator) (id, SEL, id);
finalKey = @"";
propValue = [properties objectForKey: finalKey];
/* sogo-openchange library stores the properties as NSString keys
and we have to check if the property exists using the NSString */
if (!propValue && [key isKindOfClass: [NSString class]])
propValue = [properties objectForKey: key];
comparator = (EOComparator) [propValue methodForSelector: operator];
return (comparator ? comparator (propValue, operator, value) : NO);