From f3ac7b83344c9cfce9e21efd3707436e1c356b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20J=2E=20Hern=C3=A1ndez=20Blasco?= Date: Fri, 18 Sep 2015 21:40:01 +0200 Subject: [PATCH 1/2] oc: Return FAI available properties on instance method as well The operation RopFastTransferSourceCopyTo calls the available properties for a message using the instance method. It seems the preferred method by Outlook to synchronise a FAI message. OpenChange calls the message to get the available properties, so the instance method is called. As it is specialised to return the custom hack FAI properties, we have to call that class method instead of using generic one available at NSObject (MAPIStoreProperties) class. This avoids crashing the Outlook client after we synchronise the calendar folder after changing the timeframe view (eg from day view to month view). --- OpenChange/MAPIStoreDBMessage.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OpenChange/MAPIStoreDBMessage.m b/OpenChange/MAPIStoreDBMessage.m index 7c208b2f8..8b41dcaba 100644 --- a/OpenChange/MAPIStoreDBMessage.m +++ b/OpenChange/MAPIStoreDBMessage.m @@ -76,6 +76,13 @@ return MAPISTORE_SUCCESS; } +- (enum mapistore_error) getAvailableProperties: (struct SPropTagArray **) propertiesP + inMemCtx: (TALLOC_CTX *) memCtx +{ + return [[self class] getAvailableProperties: propertiesP + inMemCtx: memCtx]; +} + - (id) initWithSOGoObject: (id) newSOGoObject inContainer: (MAPIStoreObject *) newContainer { From deca6e383a8a117b3b318d89e5b9c038df968656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20J=2E=20Hern=C3=A1ndez=20Blasco?= Date: Fri, 18 Sep 2015 21:45:00 +0200 Subject: [PATCH 2/2] oc: Include 0x683d0040 as another unknown FAI message property And returning right type. We have sorted the FAI properties by number and set the available name as a comment to ease the tracking afterwards. --- OpenChange/MAPIStoreDBMessage.m | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/OpenChange/MAPIStoreDBMessage.m b/OpenChange/MAPIStoreDBMessage.m index 8b41dcaba..bb5acbb57 100644 --- a/OpenChange/MAPIStoreDBMessage.m +++ b/OpenChange/MAPIStoreDBMessage.m @@ -45,16 +45,28 @@ @implementation MAPIStoreDBMessage -+ (int) getAvailableProperties: (struct SPropTagArray **) propertiesP - inMemCtx: (TALLOC_CTX *) memCtx ++ (enum mapistore_error) getAvailableProperties: (struct SPropTagArray **) propertiesP + inMemCtx: (TALLOC_CTX *) memCtx { struct SPropTagArray *properties; NSUInteger count; - enum MAPITAGS faiProperties[] = { 0x68350102, 0x683c0102, 0x683e0102, - 0x683f0102, 0x68410003, 0x68420102, - 0x68450102, 0x68460003, - // PR_VD_NAME_W, PR_VD_FLAGS, PR_VD_VERSION, PR_VIEW_CLSID - 0x7006001F, 0x70030003, 0x70070003, 0x68330048 }; + + enum MAPITAGS faiProperties[] = { + 0x68330048, /* PR_VIEW_CLSID */ + 0x68350102, /* PR_VIEW_STATE */ + 0x683c0102, + 0x683d0040, + 0x683e0102, + 0x683f0102, /* PR_VIEW_VIEWTYPE_KEY */ + 0x68410003, + 0x68420102, + 0x68450102, + 0x68460003, + 0x7006001F, /* PR_VD_NAME_W */ + 0x70030003, /* PR_VD_FLAGS */ + 0x70070003 /* PR_VD_VERSION */ + }; + size_t faiSize = sizeof(faiProperties) / sizeof(enum MAPITAGS); properties = talloc_zero (memCtx, struct SPropTagArray);