From cb0092b2ac13c9e03520af12ed8e0ee3589f5e0b Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 30 Nov 2011 14:40:40 +0000 Subject: [PATCH] Monotone-Parent: 8c10ce9de7820d19a0bad6bafc866e1949cd0540 Monotone-Revision: 9571c9ae651f3733c9c79a5898429b428d520a75 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-11-30T14:40:40 --- ChangeLog | 6 ++++++ SoObjects/SOGo/SOGoObject.m | 38 +++++++++++++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 228dd96b3..9f9bee2b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2011-11-30 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoObject.m (-davComplianceClassesInContext:): + declare "calendar-query-extended", "extended-mkcol", + "calendarserver-principal-property-search" as additional calendar + classes, even though it's a lie. + (-davCurrentUserPrincipal): new method. + * SoObjects/Appointments/SOGoAppointmentFolder.m (-davResourceId): new DAV getter. diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index 1e237bc5c..8736cf050 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -1211,14 +1211,48 @@ /* CalDAV */ if (needCalDAVClasses) { - caldavClasses = [NSArray arrayWithObjects: @"calendar-access", @"calendar-schedule", - @"calendar-auto-schedule", @"calendar-proxy", nil]; + caldavClasses = [NSArray arrayWithObjects: @"calendar-access", + @"calendar-schedule", + @"calendar-auto-schedule", + @"calendar-proxy", + // @"calendarserver-private-events", + // @"calendarserver-private-comments", + // @"calendarserver-sharing", + // @"calendarserver-sharing-no-scheduling", + @"calendar-query-extended", + @"extended-mkcol", + @"calendarserver-principal-property-search", + nil]; [classes addObjectsFromArray: caldavClasses]; } return classes; } +- (SOGoWebDAVValue *) davCurrentUserPrincipal +{ + NSDictionary *userHREF; + NSString *login; + SOGoUser *activeUser; + SOGoWebDAVValue *davCurrentUserPrincipal; + + activeUser = [[self context] activeUser]; + login = [activeUser login]; + if ([login isEqualToString: @"anonymous"]) + davCurrentUserPrincipal = nil; + else + { + userHREF = davElementWithContent (@"href", XMLNS_WEBDAV, [self davURLAsString]); + davCurrentUserPrincipal + = [davElementWithContent (@"current-user-principal", + XMLNS_WEBDAV, + userHREF) + asWebDAVValue]; + } + + return davCurrentUserPrincipal; +} + /* dav acls */ - (NSString *) davRecordForUser: (NSString *) user parameters: (NSArray *) params