caldavBackend, $principal, $this->l10n, $this->config, $this->logger, ); } return new CalendarHome( $this->caldavBackend, $principal, $this->logger, $this->federatedCalendarFactory, array_key_exists($principal['uri'], $this->returnCachedSubscriptions) ); } public function getName() { if ($this->principalPrefix === 'principals/calendar-resources' || $this->principalPrefix === 'principals/calendar-rooms') { $parts = explode('/', $this->principalPrefix); return $parts[1]; } if ($this->principalPrefix === RemoteUserPrincipalBackend::PRINCIPAL_PREFIX) { return 'remote-calendars'; } return parent::getName(); } public function enableReturnCachedSubscriptions(string $principalUri): void { $this->returnCachedSubscriptions['principals/users/' . $principalUri] = true; } public function childExists($name) { if (!($this->principalBackend instanceof Principal)) { return parent::childExists($name); } // Fetch the most shallow version of the principal just to determine if it exists $principalInfo = $this->principalBackend->getPrincipalPropertiesByPath( $this->principalPrefix . '/' . $name, [], ); if ($principalInfo === null) { return false; } try { return $this->getChildForPrincipal($principalInfo) !== null; } catch (NotFound $e) { return false; } } }