From a58d1e6b06d553927ff6b80822074e640ee66a9c Mon Sep 17 00:00:00 2001 From: Anna Larch Date: Mon, 27 Sep 2021 14:58:16 +0200 Subject: Add Public Calendar Provider Signed-off-by: Anna Larch Signed-off-by: Christoph Wurst --- .../AppFramework/Bootstrap/RegistrationContext.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'lib/private/AppFramework') diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php index 30ac63281d1..8eed6a5bde4 100644 --- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php +++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php @@ -35,6 +35,7 @@ use OCP\AppFramework\Bootstrap\IRegistrationContext; use OCP\AppFramework\Middleware; use OCP\AppFramework\Services\InitialStateProvider; use OCP\Authentication\IAlternativeLogin; +use OCP\Calendar\ICalendarProvider; use OCP\Capabilities\ICapability; use OCP\Dashboard\IManager; use OCP\Dashboard\IWidget; @@ -95,6 +96,9 @@ class RegistrationContext { /** @var ServiceRegistration<\OCP\Authentication\TwoFactorAuth\IProvider>[] */ private $twoFactorProviders = []; + /** @var ServiceRegistration[] */ + private $calendarProviders = []; + /** @var LoggerInterface */ private $logger; @@ -225,6 +229,13 @@ class RegistrationContext { $twoFactorProviderClass ); } + + public function registerCalendarProvider(string $class): void { + $this->context->registerCalendarProvider( + $this->appId, + $class + ); + } }; } @@ -300,6 +311,10 @@ class RegistrationContext { $this->twoFactorProviders[] = new ServiceRegistration($appId, $class); } + public function registerCalendarProvider(string $appId, string $class): void { + $this->calendarProviders[] = new ServiceRegistration($appId, $class); + } + /** * @param App[] $apps */ @@ -530,4 +545,11 @@ class RegistrationContext { public function getTwoFactorProviders(): array { return $this->twoFactorProviders; } + + /** + * @return ServiceRegistration[] + */ + public function getCalendarProviders(): array { + return $this->calendarProviders; + } } -- cgit v1.2.3