aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/Bootstrap
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2021-04-14 08:45:07 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2021-04-16 13:56:28 +0200
commit808e5890355a9f719bd6db5f74c3514a07140963 (patch)
treeedd1ca1f4a5e8c3a1ba31f9d1c7aff54351fc459 /lib/private/AppFramework/Bootstrap
parent403388269a15c11e06c8d8585fefec4e78aa343b (diff)
downloadnextcloud-server-808e5890355a9f719bd6db5f74c3514a07140963.tar.gz
nextcloud-server-808e5890355a9f719bd6db5f74c3514a07140963.zip
Allow registering NotifierServices trough IBootstrap
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/AppFramework/Bootstrap')
-rw-r--r--lib/private/AppFramework/Bootstrap/RegistrationContext.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
index 4850de94ed4..662296b8dd6 100644
--- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php
+++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
@@ -44,6 +44,7 @@ use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Template\ICustomTemplateProvider;
use OCP\Http\WellKnown\IHandler;
use OCP\ILogger;
+use OCP\Notification\INotifier;
use OCP\Search\IProvider;
use OCP\Support\CrashReport\IReporter;
use Throwable;
@@ -90,6 +91,9 @@ class RegistrationContext {
/** @var ServiceRegistration<ICustomTemplateProvider>[] */
private $templateProviders = [];
+ /** @var ServiceRegistration<INotifier>[] */
+ private $notifierServices;
+
/** @var ILogger */
private $logger;
@@ -206,6 +210,13 @@ class RegistrationContext {
$providerClass
);
}
+
+ public function registerNotifierService(string $notifierClass): void {
+ $this->context->registerNotifierService(
+ $this->appId,
+ $notifierClass
+ );
+ }
};
}
@@ -273,6 +284,10 @@ class RegistrationContext {
$this->templateProviders[] = new ServiceRegistration($appId, $class);
}
+ public function registerNotifierService(string $appId, string $class): void {
+ $this->notifierServices[] = new ServiceRegistration($appId, $class);
+ }
+
/**
* @param App[] $apps
*/
@@ -457,4 +472,11 @@ class RegistrationContext {
public function getTemplateProviders(): array {
return $this->templateProviders;
}
+
+ /**
+ * @return ServiceRegistration<INotifier>[]
+ */
+ public function getNotifierServices(): array {
+ return $this->notifierServices;
+ }
}