merge of '1306bcb572d16a67199e32e625572c3430d39626'

and 'c44d651c982e7aefb1a028f246dcc968eeefaa79'

Monotone-Parent: 1306bcb572d16a67199e32e625572c3430d39626
Monotone-Parent: c44d651c982e7aefb1a028f246dcc968eeefaa79
Monotone-Revision: be3a69319a721514c55dc1723be3091485efcaa6

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-12-01T21:15:29
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2008-12-01 21:15:29 +00:00
+25 -6
View File
@@ -449,7 +449,9 @@
event = [eventObject lookupOccurence: recurrenceTime];
if (event == nil)
// If no occurence found, create one
event = [eventObject newOccurenceWithID: recurrenceTime];
events = [NSArray arrayWithObject: event];
}
@@ -890,8 +892,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
@@ -930,21 +934,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"]
@@ -953,7 +970,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];
}
}