From 961302407db37073606f9be1bb2507f3f7634b5e Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 10 Jul 2012 16:02:16 +0000 Subject: [PATCH] Monotone-Parent: eb2ae1364da011cec8f9e025b9b53785ba2647d6 Monotone-Revision: fcec9822c0aaee8cefba77d0f50a8582b33fa3f0 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-07-10T16:02:16 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 11 +++ .../Appointments/SOGoAppointmentFolder.m | 78 +++++++++++++++++++ 2 files changed, 89 insertions(+) diff --git a/ChangeLog b/ChangeLog index e1747cb15..8e3df2cf8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2012-07-10 Wolfgang Sourdeau + * SoObjects/Appointments/SOGoAppointmentFolder.m + (-davNotifyOnPersonalModifications) + (-setDavNotifyOnPersonalModifications:) + (-davNotifyOnExternalModifications) + (-setDavNotifyOnExternalModifications:) + (-davNotifyUserOnPersonalModifications) + (-setDavNotifyUserOnPersonalModifications:) + (-davNotifiedUserOnPersonalModifications) + (-setDavNotifiedUserOnPersonalModifications:): new dav accessors. + + * SoObjects/SOGo/SOGoObject.m (-davBooleanForResult:): new method that returns a valid DAV boolean from a BOOL. (-isValidDAVBoolean:): new method that validates the value as a diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index a271c7b22..29a64b77b 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -2273,6 +2273,84 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir return error; } +- (NSString *) davNotifyOnPersonalModifications +{ + return [self davBooleanForResult: [self notifyOnPersonalModifications]]; +} + +- (NSException *) setDavNotifyOnPersonalModifications: (NSString *) newBoolean +{ + NSException *error; + + if ([self isValidDAVBoolean: newBoolean]) + { + [self setNotifyOnPersonalModifications: + [self resultForDAVBoolean: newBoolean]]; + error = nil; + } + else + error = [NSException exceptionWithHTTPStatus: 400 + reason: @"Bad boolean value."]; + + return error; +} + +- (NSString *) davNotifyOnExternalModifications +{ + return [self davBooleanForResult: [self notifyOnExternalModifications]]; +} + +- (NSException *) setDavNotifyOnExternalModifications: (NSString *) newBoolean +{ + NSException *error; + + if ([self isValidDAVBoolean: newBoolean]) + { + [self setNotifyOnExternalModifications: + [self resultForDAVBoolean: newBoolean]]; + error = nil; + } + else + error = [NSException exceptionWithHTTPStatus: 400 + reason: @"Bad boolean value."]; + + return error; +} + +- (NSString *) davNotifyUserOnPersonalModifications +{ + return [self davBooleanForResult: [self notifyUserOnPersonalModifications]]; +} + +- (NSException *) setDavNotifyUserOnPersonalModifications: (NSString *) newBoolean +{ + NSException *error; + + if ([self isValidDAVBoolean: newBoolean]) + { + [self setNotifyUserOnPersonalModifications: + [self resultForDAVBoolean: newBoolean]]; + error = nil; + } + else + error = [NSException exceptionWithHTTPStatus: 400 + reason: @"Bad boolean value."]; + + return error; +} + +- (NSString *) davNotifiedUserOnPersonalModifications +{ + return [self notifiedUserOnPersonalModifications]; +} + +- (NSException *) setDavNotifiedUserOnPersonalModifications: (NSString *) theUser +{ + [self setNotifiedUserOnPersonalModifications: theUser]; + + return nil; +} + /* vevent UID handling */ - (NSString *) resourceNameForEventUID: (NSString *) uid