Monotone-Parent: 13af0049df662f524304f42aacc2ca3dda868fc6

Monotone-Revision: 9644df847f3d64262029a478a7508355366a0d57

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-12-05T16:11:41
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle committed 2008-12-05 16:11:41 +00:00
1 parent fbdb62e9e1
commit 30f832a375
4 files changed
+120 -34

No files matched your search

+25 -13
View File
@@ -205,7 +205,6 @@
}
}
#warning what about occurences?
- (void) _removeEventFromUID: (NSString *) theUID
owner: (NSString *) theOwner
withRecurrenceId: (NSCalendarDate *) recurrenceId
@@ -214,10 +213,13 @@
{
SOGoAppointmentFolder *folder;
SOGoAppointmentObject *object;
iCalEntityObject *occurence;
iCalEntityObject *currentOccurence;
iCalRepeatableEntityObject *event;
iCalCalendar *calendar;
NSString *recurrenceTime, *calendarContent;
NSMutableArray *occurences;
NSCalendarDate *currentId;
NSString *calendarContent;
int max, count;
folder = [container lookupCalendarFolderForUID: theUID];
object = [folder lookupName: nameInContainer
@@ -228,22 +230,31 @@
[object delete];
else
{
// If recurrenceId is defined, find the specified occurence
// within the repeating vEvent.
recurrenceTime = [NSString stringWithFormat: @"%f", [recurrenceId timeIntervalSince1970]];
occurence = [object lookupOccurence: recurrenceTime];
if (occurence != nil)
calendar = [object calendar: NO secure: NO];
// If recurrenceId is defined, remove the occurence from
// the repeating event.
occurences = [calendar events];
max = [occurences count];
count = 1;
while (count < max)
{
// The occurence is defined -- remove it.
calendar = [occurence parent];
[[calendar children] removeObject: occurence];
currentOccurence = [occurences objectAtIndex: count];
currentId = [currentOccurence recurrenceId];
if ([currentId compare: recurrenceId] == NSOrderedSame)
{
[[calendar children] removeObject: currentOccurence];
break;
}
count++;
}
// Add an date exception
calendar = [object calendar: NO secure: NO];
// Add an date exception.
event = (iCalRepeatableEntityObject*)[calendar firstChildWithTag: [object componentTag]];
[event addToExceptionDates: recurrenceId];
[event increaseSequence];
// We generate the updated iCalendar file and we save it
// in the database.
calendarContent = [calendar versitString];
@@ -431,6 +442,7 @@
else
{
// Event is modified -- sent update status to all attendees
// and modify their calendars.
recurrenceId = [newEvent recurrenceId];
if (recurrenceId == nil)
oldEvent = [self component: NO secure: NO];