From 24f460e9b07fb6f8fe107037dd352e6ad3dabeb6 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 9 Jul 2008 16:02:42 +0000 Subject: [PATCH] Monotone-Parent: 337924e6726c6500e1c6fb527d7aa68336314c02 Monotone-Revision: 5e7e2018cb3fa2625cceaaa04d46251c7d1bbd09 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-07-09T16:02:42 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++ .../Appointments/SOGoAppointmentFolders.m | 40 +++++++++++++++++++ SoObjects/SOGo/SOGoContentObject.m | 3 +- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index faec68d32..7481b84e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-07-09 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject + -PUTAction:_ctx]): increment the version number only if the record + is not new. + * SoObjects/Appointments/SOGoAppointmentFolder.m ([SOGoAppointmentFolder -davCalendarFreeBusySet]): new method that returns the HREF to the calendars involved in the user's freebusy. diff --git a/SoObjects/Appointments/SOGoAppointmentFolders.m b/SoObjects/Appointments/SOGoAppointmentFolders.m index 5490f021e..d0dd127b9 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolders.m +++ b/SoObjects/Appointments/SOGoAppointmentFolders.m @@ -23,6 +23,10 @@ #import #import +#import +#import +#import + #import "SOGoAppointmentFolder.h" #import "SOGoAppointmentFolders.h" @@ -44,6 +48,42 @@ return [self labelForKey: @"Personal Calendar"]; } +- (id) lookupName: (NSString *) name + inContext: (WOContext *) lookupContext + acquire: (BOOL) acquire +{ + id obj; + WORequest *rq; + + obj = [super lookupName: name inContext: lookupContext acquire: NO]; + + rq = [context request]; + if ([rq isSoWebDAVRequest] + && [[rq method] isEqualToString: @"MKCALENDAR"]) + { + if (obj) + obj = [NSException exceptionWithHTTPStatus: 403]; + else + { + obj = [self newFolderWithName: name andNameInContainer: name]; + if (!obj) + obj = [super lookupName: name inContext: lookupContext acquire: NO]; + } + } + + return obj; +} + +- (id) doMKCALENDAR: (id) test +{ + return nil; +} + +- (id) MKCALENDARAction: (id) localContext +{ + return nil; +} + #warning THIS CAUSES LIGHTNING TO FAIL (that is why its commented out) // - (NSArray *) davComplianceClassesInContext: (id)_ctx // { diff --git a/SoObjects/SOGo/SOGoContentObject.m b/SoObjects/SOGo/SOGoContentObject.m index d4c6e82db..e3e36605c 100644 --- a/SoObjects/SOGo/SOGoContentObject.m +++ b/SoObjects/SOGo/SOGoContentObject.m @@ -306,7 +306,8 @@ response = (WOResponse *) error; else { - version++; + if (!isNew) + version++; response = [_ctx response]; /* setup response */