Added addToCalendar method to add calendar from an email invitation

Monotone-Parent: 154f2a301f669b275706368200446169ee67b579
Monotone-Revision: cea719aec080dc3ba804233ec84e32d27a1d338a

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2009-06-30T19:20:10
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2009-06-30 19:20:10 +00:00
parent 470917d096
commit 3f1671e4f0
4 changed files with 50 additions and 3 deletions
@@ -378,6 +378,38 @@
return [self _changePartStatusAction: @"DECLINED"];
}
- (WOResponse *) addToCalendarAction
{
iCalEvent *emailEvent;
SOGoAppointmentObject *eventObject;
NSString *iCalString;
WOResponse *response;
emailEvent = [self _emailEvent];
if (emailEvent)
{
eventObject = [self _eventObjectWithUID: [emailEvent uid]];
if ([eventObject isNew])
{
iCalString = [[emailEvent parent] versitString];
[eventObject saveContentString: iCalString];
response = [self responseWith204];
}
else
{
response = [self responseWithStatus: 409];
}
}
else
{
response = [context response];
[response setStatus: 409];
response = [self responseWithStatus: 404];
}
return response;
}
- (WOResponse *) deleteFromCalendarAction
{
iCalEvent *emailEvent;