From 266586d9048a0eb42e8f121dac7004418cc3cd5b Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 1 Dec 2008 16:24:15 +0000 Subject: [PATCH 1/2] Monotone-Parent: a81f3635524596f99835829a1a4835f3a7f58c1b Monotone-Revision: 4804ccb0f75341fb484b9540603a55565d6e29e5 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-12-01T16:24:15 Monotone-Branch: ca.inverse.sogo --- SoObjects/Appointments/SOGoAppointmentObject.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 478e90b10..bfc654489 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -447,7 +447,9 @@ event = [eventObject lookupOccurence: recurrenceTime]; if (event == nil) + // If no occurence found, create one event = [eventObject newOccurenceWithID: recurrenceTime]; + events = [NSArray arrayWithObject: event]; } @@ -888,8 +890,10 @@ // within the repeating vEvent. recurrenceTime = [NSString stringWithFormat: @"%f", [_recurrenceId timeIntervalSince1970]]; event = [self lookupOccurence: recurrenceTime]; - // If no occurence found, create one - event = [self newOccurenceWithID: recurrenceTime]; + + if (event == nil) + // If no occurence found, create one + event = [self newOccurenceWithID: recurrenceTime]; } else // No specific occurence specified; return the first vEvent of From 2582979066452a4bdc0cb9624b7387a15fb8ab1c Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 1 Dec 2008 21:15:07 +0000 Subject: [PATCH 2/2] Monotone-Parent: 4804ccb0f75341fb484b9540603a55565d6e29e5 Monotone-Revision: c44d651c982e7aefb1a028f246dcc968eeefaa79 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-12-01T21:15:07 Monotone-Branch: ca.inverse.sogo --- .../Appointments/SOGoAppointmentObject.m | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index bfc654489..356155f84 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -932,21 +932,34 @@ iCalEvent *event; SOGoUser *ownerUser, *currentUser; NSArray *attendees; + NSCalendarDate *recurrenceId; if ([[context request] handledByDefaultHandler]) { ownerUser = [SOGoUser userWithLogin: owner roles: nil]; event = [self component: NO secure: NO]; - if (!occurence) - occurence = event; + + if (occurence == nil) + { + // No occurence specified; use the master event. + occurence = event; + recurrenceId = nil; + } + else + // Retrieve this occurence ID. + recurrenceId = [occurence recurrenceId]; + if ([event userIsOrganizer: ownerUser]) { - currentUser = [context activeUser]; // is this correct? + // The organizer deletes an occurence. + currentUser = [context activeUser]; attendees = [occurence attendeesWithoutUser: currentUser]; if (![attendees count] && event != occurence) attendees = [event attendeesWithoutUser: currentUser]; if ([attendees count]) { + // Remove the event from all attendees calendars + // and send them an email. [self _handleRemovedUsers: attendees]; [self sendEMailUsingTemplateNamed: @"Deletion" forObject: [occurence itipEntryWithMethod: @"cancel"] @@ -955,7 +968,9 @@ } } else if ([occurence userIsParticipant: ownerUser]) - [self changeParticipationStatus: @"DECLINED"]; + // The current user deletes the occurence; let the organizer know that + // the user has declined this occurence. + [self changeParticipationStatus: @"DECLINED" forRecurrenceId: recurrenceId]; } }