Explorar el Código

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

fix calendar-user-type reporting
tags/v17.0.0beta1
Roeland Jago Douma hace 4 años
padre
commit
1ec98af3e0
No account linked to committer's email address
Se han modificado 1 ficheros con 16 adiciones y 11 borrados
  1. 16
    11
      apps/dav/lib/CalDAV/Schedule/Plugin.php

+ 16
- 11
apps/dav/lib/CalDAV/Schedule/Plugin.php Ver fichero

@@ -27,6 +27,7 @@ namespace OCA\DAV\CalDAV\Schedule;
use OCA\DAV\CalDAV\CalDavBackend;
use OCA\DAV\CalDAV\CalendarHome;
use Sabre\DAV\INode;
use Sabre\DAV\IProperties;
use Sabre\DAV\PropFind;
use Sabre\DAV\Server;
use Sabre\DAV\Xml\Property\LocalHref;
@@ -55,19 +56,23 @@ class Plugin extends \Sabre\CalDAV\Schedule\Plugin {
* @return void
*/
function propFind(PropFind $propFind, INode $node) {
// overwrite Sabre/Dav's implementation
$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];
}
parent::propFind($propFind, $node);

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';
});
}
}

/**

Cargando…
Cancelar
Guardar