Skip to content
Snippets Groups Projects
Unverified Commit 1ec98af3 authored by Roeland Jago Douma's avatar Roeland Jago Douma Committed by GitHub
Browse files

Merge pull request #16560 from nextcloud/bugfix/noid/fix_cutype_reporting

fix calendar-user-type reporting
parents 9ef23e23 6a2a5465
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ namespace OCA\DAV\CalDAV\Schedule; ...@@ -27,6 +27,7 @@ namespace OCA\DAV\CalDAV\Schedule;
use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\CalDAV\CalDavBackend;
use OCA\DAV\CalDAV\CalendarHome; use OCA\DAV\CalDAV\CalendarHome;
use Sabre\DAV\INode; use Sabre\DAV\INode;
use Sabre\DAV\IProperties;
use Sabre\DAV\PropFind; use Sabre\DAV\PropFind;
use Sabre\DAV\Server; use Sabre\DAV\Server;
use Sabre\DAV\Xml\Property\LocalHref; use Sabre\DAV\Xml\Property\LocalHref;
...@@ -55,19 +56,23 @@ class Plugin extends \Sabre\CalDAV\Schedule\Plugin { ...@@ -55,19 +56,23 @@ class Plugin extends \Sabre\CalDAV\Schedule\Plugin {
* @return void * @return void
*/ */
function propFind(PropFind $propFind, INode $node) { function propFind(PropFind $propFind, INode $node) {
// overwrite Sabre/Dav's implementation parent::propFind($propFind, $node);
$propFind->handle('{' . self::NS_CALDAV . '}calendar-user-type', function() use ($node) {
$calendarUserType = '{' . self::NS_CALDAV . '}calendar-user-type';
$props = $node->getProperties([$calendarUserType]);
if (isset($props[$calendarUserType])) {
return $props[$calendarUserType];
}
return 'INDIVIDUAL'; if ($node instanceof IPrincipal) {
}); // overwrite Sabre/Dav's implementation
$propFind->handle('{' . self::NS_CALDAV . '}calendar-user-type', function () use ($node) {
if ($node instanceof IProperties) {
$calendarUserType = '{' . self::NS_CALDAV . '}calendar-user-type';
$props = $node->getProperties([$calendarUserType]);
if (isset($props[$calendarUserType])) {
return $props[$calendarUserType];
}
}
parent::propFind($propFind, $node); return 'INDIVIDUAL';
});
}
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment