From dadedfa2955f8d045e253f84ceb1249c6052c150 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 1 Apr 2011 18:55:02 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 20415379d4ad22b602692f50041a0eb207e1d1fb Monotone-Revision: c9f767434992867f4e642881a1161a8a606c338f Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-04-01T18:55:02 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ SoObjects/Appointments/SOGoAppointmentObject.m | 18 ++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5c01d3c85..007300c12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-04-01 Francis Lachapelle + + * SoObjects/Appointments/SOGoAppointmentObject.m (-PUTAction:): + when adding a new occurrence, instantiate an occurrence from the + previous calendar in order to perform a proper changes comparison. + 2011-04-01 Wolfgang Sourdeau * UI/WebServerResources/SchedulerUI.js (initCalendars): initialize diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 2d2de8ee5..bec825629 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -599,7 +599,7 @@ oldEvent = (iCalEvent*)[self lookupOccurence: recurrenceTime]; if (oldEvent == nil) // If no occurence found, create one - oldEvent = (iCalEvent*)[self newOccurenceWithID: recurrenceTime]; + oldEvent = (iCalEvent *)[self newOccurenceWithID: recurrenceTime]; } oldMasterEvent = (iCalEvent *) [[oldEvent parent] firstChildWithTag: [self componentTag]]; @@ -1563,6 +1563,13 @@ // If not present, we assume it was created before the PUT oldEvent = [self _eventFromRecurrenceId: [newEvent recurrenceId] events: oldEvents]; + + if (oldEvent == nil) + { + NSString *recurrenceTime; + recurrenceTime = [NSString stringWithFormat: @"%f", [[newEvent recurrenceId] timeIntervalSince1970]]; + oldEvent = (iCalEvent *)[self newOccurenceWithID: recurrenceTime]; + } // If present, we look for changes changes = [iCalEventChanges changesFromEvent: oldEvent toEvent: newEvent]; @@ -1630,8 +1637,7 @@ uid = [[newEvent organizer] uid]; else uid = [[[[[newEvent parent] events] objectAtIndex: 0] organizer] uid]; - - + if ([uid caseInsensitiveCompare: owner] == NSOrderedSame) { [self _handleUpdatedEvent: newEvent fromOldEvent: oldEvent]; @@ -1676,14 +1682,14 @@ // the user has declined this occurence. if ([[changes updatedProperties] containsObject: @"exdate"]) { - [self changeParticipationStatus: @"DECLINED" + [self changeParticipationStatus: @"DECLINED" withDelegate: nil // FIXME (specify delegate?) forRecurrenceId: [self _addedExDate: oldEvent newEvent: newEvent]]; } else [self changeParticipationStatus: [attendee partStat] - withDelegate: delegate - forRecurrenceId: recurrenceId]; + withDelegate: delegate + forRecurrenceId: recurrenceId]; } } }