From 539060d25271cc5e5ba0a28d34522f806ff4025b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Antonio=20Calvo?= Date: Thu, 16 Apr 2015 09:34:43 +0200 Subject: [PATCH] oc-calendar: Fix recipient type for invitations Take into account optional attendees setting the recipient type to MAPI_CC when they have the iCal role set to OPT-PARTICIPANT instead of harding always MAPI_TO (required) as was done before. This is a complementary fix for: https://github.com/Zentyal/sogo/pull/108 --- OpenChange/MAPIStoreAppointmentWrapper.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenChange/MAPIStoreAppointmentWrapper.m b/OpenChange/MAPIStoreAppointmentWrapper.m index 7fa60c5c5..07996572b 100644 --- a/OpenChange/MAPIStoreAppointmentWrapper.m +++ b/OpenChange/MAPIStoreAppointmentWrapper.m @@ -273,7 +273,7 @@ static NSCharacterSet *hexCharacterSet = nil; recipient->username = NULL; entryId = MAPIStoreExternalEntryId (cn, email); } - recipient->type = MAPI_TO; + recipient->type = [[person role] isEqualToString: @"OPT-PARTICIPANT"] ? MAPI_CC : MAPI_TO; /* properties */ p = 0; @@ -283,7 +283,7 @@ static NSCharacterSet *hexCharacterSet = nil; // PR_OBJECT_TYPE = MAPI_MAILUSER (see MAPI_OBJTYPE) recipient->data[p] = MAPILongValue (msgData, MAPI_MAILUSER); p++; - + // PR_DISPLAY_TYPE = DT_MAILUSER (see MS-NSPI) recipient->data[p] = MAPILongValue (msgData, 0); p++; @@ -383,7 +383,7 @@ static NSCharacterSet *hexCharacterSet = nil; // PR_OBJECT_TYPE = MAPI_MAILUSER (see MAPI_OBJTYPE) recipient->data[p] = MAPILongValue (msgData, MAPI_MAILUSER); p++; - + // PR_DISPLAY_TYPE = DT_MAILUSER (see MS-NSPI) recipient->data[p] = MAPILongValue (msgData, 0); p++;