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