From 742e7fd9368e86190f9db01af36cfdc1461b0ef0 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 9 Dec 2008 18:23:35 +0000 Subject: [PATCH] Monotone-Parent: 9f3f242b60f7db4066eb1a89daef0286cf6907af Monotone-Revision: 5335af27b0e9d71da6cdc33a28be0e109f79c8b2 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-12-09T18:23:35 Monotone-Branch: ca.inverse.sogo --- SoObjects/Appointments/SOGoAppointmentObject.m | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index e31fa6bc7..55dcbfde5 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -720,7 +720,7 @@ if (uid) { // We check if we must send an invitation update - // rather than just a normal invitation + // rather than just a normal invitation. NSString *iCalString; SOGoAppointmentObject *oldEventObject; @@ -736,6 +736,7 @@ iCalEventChanges *changes; NSArray *occurences; NSCalendarDate *recurrenceId, *currentId; + NSString *recurrenceTime; unsigned int i; calendar = [oldEventObject calendar: NO secure: NO]; @@ -745,9 +746,9 @@ else { // If recurrenceId is defined, find the specified occurence - // within the repeating vEvent and replace it. + // within the repeating vEvent and remove it. occurences = [calendar events]; - for (i = 1; i< [occurences count]; i++) + for (i = 1; i < [occurences count]; i++) { currentOccurence = [occurences objectAtIndex: i]; currentId = [currentOccurence recurrenceId]; @@ -758,6 +759,14 @@ break; } } + + if (oldEvent == nil) + { + // If no occurence found, create one. + recurrenceTime = [NSString stringWithFormat: @"%f", [recurrenceId timeIntervalSince1970]]; + oldEvent = [oldEventObject newOccurenceWithID: recurrenceTime]; + } + // Add the event as a new occurrence, without the organizer. [newEvent setOrganizer: nil]; [calendar addChild: newEvent];