From 0dafa1fbe33a081cda610f60ceb60af3032ce648 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 12 Nov 2007 19:56:20 +0000 Subject: [PATCH] Monotone-Parent: 792be98e654b3cfa62f4f11c932b36e8f665af0d Monotone-Revision: c98770f24cfa85b41238be62c18aeaad6380a583 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-12T19:56:20 Monotone-Branch: ca.inverse.sogo --- .../Appointments/SOGoAppointmentObject.m | 57 +++++++++---------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 7cc44e230..cac6db9ef 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -252,36 +252,32 @@ uid = [self getUIDForICalPerson: organizer]; if (!uid) uid = [self ownerInContext: nil]; - if (uid) { - if (![storeUIDs containsObject:uid]) - [storeUIDs addObject:uid]; - [removedUIDs removeObject:uid]; - } + if (uid) + { + [storeUIDs addObjectUniquely: uid]; + [removedUIDs removeObject: uid]; + } /* organizer might have changed completely */ - if (oldApt && ([props containsObject: @"organizer"])) { - uid = [self getUIDForICalPerson:[oldApt organizer]]; - if (uid) { - if (![storeUIDs containsObject:uid]) { - if (![removedUIDs containsObject:uid]) { - [removedUIDs addObject:uid]; - } - } + if (oldApt && ([props containsObject: @"organizer"])) + { + uid = [self getUIDForICalPerson: [oldApt organizer]]; + if (uid && ![storeUIDs containsObject: uid]) + [removedUIDs addObjectUniquely: uid]; } - } - [self debugWithFormat:@"UID ops:\n store: %@\n remove: %@", + [self debugWithFormat: @"UID ops:\n store: %@\n remove: %@", storeUIDs, removedUIDs]; /* if time did change, all participants have to re-decide ... * ... exception from that rule: the organizer */ - if (oldApt != nil && - ([props containsObject: @"startDate"] || - [props containsObject: @"endDate"] || - [props containsObject: @"duration"])) + if (oldApt + && ([props containsObject: @"startDate"] + || [props containsObject: @"endDate"] + || [props containsObject: @"duration"])) { NSArray *ps; unsigned i, count; @@ -320,15 +316,16 @@ andNewObject: newApt toAttendees: attendees]; - if (updateForcesReconsider) { - attendees = [NSMutableArray arrayWithArray:[newApt attendees]]; - [attendees removeObjectsInArray:[changes insertedAttendees]]; - [attendees removePerson:organizer]; - [self sendEMailUsingTemplateNamed: @"Update" - forOldObject: oldApt - andNewObject: newApt - toAttendees: attendees]; - } + if (updateForcesReconsider) + { + attendees = [NSMutableArray arrayWithArray:[newApt attendees]]; + [attendees removeObjectsInArray:[changes insertedAttendees]]; + [attendees removePerson:organizer]; + [self sendEMailUsingTemplateNamed: @"Update" + forOldObject: oldApt + andNewObject: newApt + toAttendees: attendees]; + } attendees = [NSMutableArray arrayWithArray: [changes deletedAttendees]]; @@ -393,8 +390,8 @@ && [self _aptIsStillRelevant: apt]) { /* send notification email to attendees excluding organizer */ - attendees = [NSMutableArray arrayWithArray:[apt attendees]]; - [attendees removePerson:[apt organizer]]; + attendees = [NSMutableArray arrayWithArray: [apt attendees]]; + [attendees removePerson: [apt organizer]]; /* flag appointment as being cancelled */ [(iCalCalendar *) [apt parent] setMethod: @"cancel"];