From fa23b574eb7f58cc8fdc679dd6c2e47a5f7090da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20J=2E=20Hern=C3=A1ndez=20Blasco?= Date: Mon, 13 Apr 2015 11:37:48 +0200 Subject: [PATCH] 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. --- SoObjects/SOGo/EOQualifier+SOGoCacheObject.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SoObjects/SOGo/EOQualifier+SOGoCacheObject.m b/SoObjects/SOGo/EOQualifier+SOGoCacheObject.m index f86f2a11c..f21e9c7d6 100644 --- a/SoObjects/SOGo/EOQualifier+SOGoCacheObject.m +++ b/SoObjects/SOGo/EOQualifier+SOGoCacheObject.m @@ -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);