From e08dd3f9eb16bdf122a398fd46a725ec33c55226 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 6 Nov 2014 10:16:47 -0500 Subject: [PATCH] Fix for bug #2978 --- ActiveSync/iCalEvent+ActiveSync.m | 28 ++++++++++++++++++++-------- NEWS | 1 + 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/ActiveSync/iCalEvent+ActiveSync.m b/ActiveSync/iCalEvent+ActiveSync.m index a54178e53..6d4d4ad4d 100644 --- a/ActiveSync/iCalEvent+ActiveSync.m +++ b/ActiveSync/iCalEvent+ActiveSync.m @@ -334,14 +334,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [o intValue]; } - // - // - // - if ((o = [theValues objectForKey: @"MeetingStatus"])) - { - [o intValue]; - } - // // 0- normal, 1- personal, 2- private and 3-confidential // @@ -482,6 +474,26 @@ 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"]) + { + iCalPerson *person; + + person = [iCalPerson elementWithTag: @"organizer"]; + [person setEmail: [[[context activeUser] primaryIdentity] objectForKey: @"email"]]; + [person setCn: [[context activeUser] cn]]; + [person setPartStat: @"ACCEPTED"]; + [self setOrganizer: person]; + } + } + + // Attendees - we don't touch the values if we're an attendee. This is gonna // be done automatically by the ActiveSync client when invoking MeetingResponse. if (![self userIsAttendee: [context activeUser]]) diff --git a/NEWS b/NEWS index 170f54b46..fa978c04c 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ Bug fixes - fixed support for Sieve folder encoding parameter (#2622) - fixed rename of subscribed addressbooks - sanitize strings before escaping them when using EAS + - fixed handling of event invitations on iOS/EAS with no organizer (#2978) 2.2.9a (2014-09-29) -------------------