apps/dav/lib/CalDAV/Schedule/Plugin.php
/**
	 * Always use the personal calendar as target for scheduled events
	 *
	 * @param PropFind $propFind
	 * @param INode $node
	 * @return void
	 */
Always use the personal calendar as target for scheduled events
@param PropFind $propFind
@param INode $node
@return void
Always use the personal calendar as target for scheduled events @param PropFind $propFind @param INode $node @return void
function propFindDefaultCalendarUrl(PropFind $propFind, INode $node) {
		if ($node instanceof IPrincipal) {
			$propFind->handle('{' . self::NS_CALDAV . '}schedule-default-calendar-URL', function() use ($node) {
				$caldavPlugin = $this->server->getPlugin('caldav');
				$principalUrl = $node->getPrincipalUrl();
				$calendarHomePath = $caldavPlugin->getCalendarHomeForPrincipal($principalUrl);
				if (!$calendarHomePath) {
					return null;
				}
				$calendarHome = $this->server->tree->getNodeForPath($calendarHomePath);
				if (!$calendarHome->childExists(CalDavBackend::PERSONAL_CALENDAR_URI)) {
					$calendarHome->getCalDAVBackend()->createCalendar($principalUrl, CalDavBackend::PERSONAL_CALENDAR_URI, [
						'{DAV:}displayname' => CalDavBackend::PERSONAL_CALENDAR_NAME,
					]);
				}
				$result = $this->server->getPropertiesForPath($calendarHomePath . '/' . CalDavBackend::PERSONAL_CALENDAR_URI, [], 1);
				if (empty($result)) {
					return null;
				}
				return new LocalHref($result[0]['href']);
			});
		}
	}
function propFindDefaultCalendarUrl ( PropFind $ propFind , INode $ node ) { if ( $ node instanceof IPrincipal ) { $ propFind -> handle ( '{' . self :: NS_CALDAV . '}schedule-default-calendar-URL' , function ( ) use ( $ node ) { $ caldavPlugin = $ this -> server -> getPlugin ( 'caldav' ) ; $ principalUrl = $ node -> getPrincipalUrl ( ) ; $ calendarHomePath = $ caldavPlugin -> getCalendarHomeForPrincipal ( $ principalUrl ) ; if ( ! $ calendarHomePath ) { return null ; } $ calendarHome = $ this -> server -> tree -> getNodeForPath ( $ calendarHomePath ) ; if ( ! $ calendarHome -> childExists ( CalDavBackend :: PERSONAL_CALENDAR_URI ) ) { $ calendarHome -> getCalDAVBackend ( ) -> createCalendar ( $ principalUrl , CalDavBackend :: PERSONAL_CALENDAR_URI , [ '{DAV:}displayname' => CalDavBackend :: PERSONAL_CALENDAR_NAME , ] ) ; } $ result = $ this -> server -> getPropertiesForPath ( $ calendarHomePath . '/' . CalDavBackend :: PERSONAL_CALENDAR_URI , [ ] , 1 ) ; if ( empty ( $ result ) ) { return null ; } return new LocalHref ( $ result [ 0 ] [ 'href' ] ) ; } ) ; } }
Always use the personal calendar as target for scheduled events
 @param PropFind $propFind
 @param INode $node
 @return void
Always use the personal calendar as target for scheduled events @param PropFind $propFind @param INode $node @return void
/** @var \OCA\DAV\CalDAV\Plugin $caldavPlugin */ /** @var CalendarHome $calendarHome */