diff --git a/ActiveSync/iCalEvent+ActiveSync.m b/ActiveSync/iCalEvent+ActiveSync.m index 586bf5798..2156b1eac 100644 --- a/ActiveSync/iCalEvent+ActiveSync.m +++ b/ActiveSync/iCalEvent+ActiveSync.m @@ -506,14 +506,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [self setOrganizer: person]; } - // - // iOS is plain stupid here. It seends event invitations with no Organizer. - // We check this corner-case and if MeetingStatus == 1 (see http://msdn.microsoft.com/en-us/library/ee219342(v=exchg.80).aspx or details) - // and there's no organizer, we fake one. - // if ((o = [theValues objectForKey: @"MeetingStatus"])) { - if ([o intValue] == 1 && ![theValues objectForKey: @"Organizer_Email"]) + // + // iOS is plain stupid here. It seends event invitations with no Organizer. + // We check this corner-case and if MeetingStatus == 1 (see http://msdn.microsoft.com/en-us/library/ee219342(v=exchg.80).aspx or details) + // and there's no organizer, we fake one. + // + if ([o intValue] == 1 && ![theValues objectForKey: @"Organizer_Email"] && ![[[self organizer] rfc822Email] length]) { iCalPerson *person; @@ -523,6 +523,20 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [person setPartStat: @"ACCEPTED"]; [self setOrganizer: person]; } + + // + // When MeetingResponse fails Outlook still sends a new calendar entry with MeetingStatus=3. + // Use the organizer from the request if the event has no organizer. + // + if ([o intValue] == 3 && [theValues objectForKey: @"Organizer_Email"] && ![[[self organizer] rfc822Email] length]) + { + iCalPerson *person; + person = [iCalPerson elementWithTag: @"organizer"]; + [person setEmail: [theValues objectForKey: @"Organizer_Email"]]; + [person setCn: [theValues objectForKey: @"Organizer_Name"]]; + [person setPartStat: @"ACCEPTED"]; + [self setOrganizer: person]; + } } diff --git a/NEWS b/NEWS index e325847da..b06a4175c 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ Bug fixes - EAS's GetItemEstimate/ItemOperations now support fetching mails and empty folders - fixed some rare cornercases in multidomain configurations - properly escape folder after creation using EAS (#3237) + - fixed potential organizer highjacking when using EAS (#3131) 2.3.0 (2015-06-01) -------------------