See ChangeLog

Monotone-Parent: 814be30289e980e05d1340e3dc8d3bad9155344d
Monotone-Revision: 916c7ceb6091d24b72b12cfcc4cb930fd83a96f8

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2008-11-18T20:59:08
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Ludovic Marcotte
2008-11-18 20:59:08 +00:00
parent 3539a06f83
commit 6c6600bde4
2 changed files with 39 additions and 8 deletions

View File

@@ -1,3 +1,9 @@
2008-11-18 Ludovic Marcotte <lmarcotte@inverse.ca>
* SoObjects/Appointments/SOGoAppointmentObject.m
Modified postCalDAVEventRequestTo: from: to handle
invitation updates from normal ones.
2008-11-17 Ludovic Marcotte <lmarcotte@inverse.ca>
* Added back the appointment update notification

View File

@@ -557,9 +557,10 @@
NSMutableArray *elements;
NSEnumerator *recipientsEnum;
NSString *recipient, *uid;
iCalEvent *event;
iCalEvent *event, *oldEvent;
iCalPerson *person;
BOOL isUpdate, hasChanged;
elements = [NSMutableArray array];
event = [self component: NO secure: NO];
@@ -570,13 +571,37 @@
person = [iCalPerson new];
[person setValue: 0 to: recipient];
uid = [person uid];
if (uid)
[self _addOrUpdateEvent: event forUID: uid];
oldEvent = nil;
hasChanged = YES;
isUpdate = NO;
if (uid)
{
// We check if we must send an invitation update
// rather than just a normal invitation
SOGoAppointmentObject *oldEventObject;
iCalEventChanges *changes;
oldEventObject = [self _lookupEvent: [event uid] forUID: uid];
oldEvent = [oldEventObject component: NO secure: NO];
changes = [event getChangesRelativeToEvent: oldEvent];
if ([[oldEvent sequence] compare: [event sequence]] != NSOrderedSame)
{
if ([changes sequenceShouldBeIncreased])
isUpdate = YES;
else
hasChanged = NO;
}
[self _addOrUpdateEvent: event forUID: uid];
}
#warning fix this when sendEmailUsing blabla has been cleaned up
[self sendEMailUsingTemplateNamed: @"Invitation"
forObject: event
previousObject: nil
toAttendees: [NSArray arrayWithObject: person]];
if (hasChanged)
[self sendEMailUsingTemplateNamed: (isUpdate ? @"Update" : @"Invitation")
forObject: event
previousObject: oldEvent
toAttendees: [NSArray arrayWithObject: person]];
[person release];
[elements
addObject: [self _caldavSuccessCodeWithRecipient: recipient]];