From 8c4cb64246d1f5cfa7511882c963f30318eed4d1 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 4 Jun 2015 11:39:54 -0400 Subject: [PATCH] (fix) now always enforce the organizer's default identity in appointments --- NEWS | 1 + SoObjects/Appointments/SOGoAppointmentObject.m | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/NEWS b/NEWS index d220b304e..e94d10e20 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ Enhancements - improved EAS speed, especially when fetching big attachments + - now always enforce the organizer's default identity in appointments Bug fixes - EAS's GetItemEstimate/ItemOperations now support fetching mails and empty folders diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 4e1371dc8..42bc57d55 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -1802,6 +1802,7 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent { NSArray *allEvents; iCalEvent *event; + NSString *uid; NSUInteger i; allEvents = [rqCalendar events]; @@ -1824,6 +1825,20 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent { [[event organizer] setCn: [[event organizer] rfc822Email]]; } + + // We now make sure that the organizer, if managed by SOGo, is using + // its default email when creating events and inviting attendees. + uid = [[SOGoUserManager sharedUserManager] getUIDForEmail: [[event organizer] rfc822Email]]; + if (uid) + { + NSDictionary *defaultIdentity; + SOGoUser *organizer; + + organizer = [SOGoUser userWithLogin: uid]; + defaultIdentity = [organizer defaultIdentity]; + [[event organizer] setCn: [defaultIdentity objectForKey: @"fullName"]]; + [[event organizer] setEmail: [defaultIdentity objectForKey: @"email"]]; + } } }