merge of 'c37895534ea03712cf65f5760bc535177a041d99'

and 'c9f767434992867f4e642881a1161a8a606c338f'

Monotone-Parent: c37895534ea03712cf65f5760bc535177a041d99
Monotone-Parent: c9f767434992867f4e642881a1161a8a606c338f
Monotone-Revision: 50ca38f0849cc20be6979e82924895e7b1c2e27f

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-04-01T19:43:44
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau 2011-04-01 19:43:44 +00:00
commit 3d6309eda4
2 changed files with 18 additions and 6 deletions

View file

@ -1,3 +1,9 @@
2011-04-01 Francis Lachapelle <flachapelle@inverse.ca>
* 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 <wsourdeau@inverse.ca>
* Tests/Integration/all.py: (from Jean Raby) make use of the

View file

@ -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];
}
}
}