From ebe2a466e7ac3d6aa0f10befc9367555224ac752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Vall=C3=A9s?= Date: Tue, 5 May 2015 10:28:58 +0200 Subject: [PATCH] oc-calendar: Compute PidLidAppointmentDefinitionStartWhole for all-day events --- OpenChange/MAPIStoreAppointmentWrapper.m | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/OpenChange/MAPIStoreAppointmentWrapper.m b/OpenChange/MAPIStoreAppointmentWrapper.m index b1a6fc511..85f923463 100644 --- a/OpenChange/MAPIStoreAppointmentWrapper.m +++ b/OpenChange/MAPIStoreAppointmentWrapper.m @@ -2073,17 +2073,21 @@ ReservedBlockEE2Size: 00 00 00 00 enum mapistore_error rc; iCalTimeZone *icalTZ; - if ([event isRecurrent]) + /* [MS-OXOCAL] 3.1.5.5.1: This property is used in floating (all-day) events, + specified in floating time, to convert the start date from UTC to the user's + time zone */ + if ([event isAllDay]) + icalTZ = [iCalTimeZone timeZoneForName: [timeZone timeZoneName]]; + else if ([event isRecurrent]) + icalTZ = [(iCalDateTime *) [event firstChildWithTag: @"dtstart"] timeZone]; + + if (icalTZ) { - icalTZ = [(iCalDateTime *) [event firstChildWithTag: @"dtstart"] timeZone]; - if (icalTZ) - { - *data = [icalTZ asZoneTimeDefinitionWithFlags: TZRULE_FLAG_EFFECTIVE_TZREG | TZRULE_FLAG_RECUR_CURRENT_TZREG - inMemCtx: memCtx]; - rc = MAPISTORE_SUCCESS; - } - else - rc = MAPISTORE_ERR_NOT_FOUND; + /* [MS-OXOCAL] 2.2.1.42: This property can only have the E flag set in the + TimeZoneDefinition struct */ + *data = [icalTZ asZoneTimeDefinitionWithFlags: TZRULE_FLAG_EFFECTIVE_TZREG + inMemCtx: memCtx]; + rc = MAPISTORE_SUCCESS; } else rc = MAPISTORE_ERR_NOT_FOUND;