From 45541eb685c4f3a5742508afcc02d07e46e64b5f Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Wed, 15 Nov 2023 15:03:48 +0100 Subject: feat(dav): Enable OOO UI and expose enabled via OCP Makes the feature opt-out now that we have meaningful integrations based on OOO data. Allows instances still to turn the feature off. For apps like Mail that build on top of this feature we need to know if the instance has the feature turned on or off. This is exposed as OCP API, too. Signed-off-by: Christoph Wurst --- apps/dav/lib/Settings/AvailabilitySettings.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'apps/dav') diff --git a/apps/dav/lib/Settings/AvailabilitySettings.php b/apps/dav/lib/Settings/AvailabilitySettings.php index e2f2fe7cef6..c48ebe0255e 100644 --- a/apps/dav/lib/Settings/AvailabilitySettings.php +++ b/apps/dav/lib/Settings/AvailabilitySettings.php @@ -33,6 +33,7 @@ use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IInitialState; use OCP\IConfig; use OCP\Settings\ISettings; +use OCP\User\IAvailabilityCoordinator; use Psr\Log\LoggerInterface; class AvailabilitySettings implements ISettings { @@ -44,6 +45,7 @@ class AvailabilitySettings implements ISettings { IInitialState $initialState, ?string $userId, private LoggerInterface $logger, + private IAvailabilityCoordinator $coordinator, private AbsenceMapper $absenceMapper) { $this->config = $config; $this->initialState = $initialState; @@ -60,11 +62,7 @@ class AvailabilitySettings implements ISettings { 'no' ) ); - $hideAbsenceSettings = $this->config->getAppValue( - Application::APP_ID, - 'hide_absence_settings', - 'yes', - ) === 'yes'; + $hideAbsenceSettings = !$this->coordinator->isEnabled(); $this->initialState->provideInitialState('hide_absence_settings', $hideAbsenceSettings); if (!$hideAbsenceSettings) { try { -- cgit v1.2.3