overwrite Sabre/DAV's handler for calendar-user-type to report correct user type
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
parent
325e366b58
commit
10f0296ad6
|
@ -49,6 +49,31 @@ class Plugin extends \Sabre\CalDAV\Schedule\Plugin {
|
|||
$server->on('propFind', [$this, 'propFindDefaultCalendarUrl'], 90);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method handler is invoked during fetching of properties.
|
||||
*
|
||||
* We use this event to add calendar-auto-schedule-specific properties.
|
||||
*
|
||||
* @param PropFind $propFind
|
||||
* @param INode $node
|
||||
* @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];
|
||||
}
|
||||
|
||||
return 'INDIVIDUAL';
|
||||
});
|
||||
|
||||
parent::propFind($propFind, $node);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of addresses that are associated with a principal.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue