aboutsummaryrefslogtreecommitdiffstats
path: root/apps/comments/lib/AppInfo/Application.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/comments/lib/AppInfo/Application.php')
-rw-r--r--apps/comments/lib/AppInfo/Application.php23
1 files changed, 8 insertions, 15 deletions
diff --git a/apps/comments/lib/AppInfo/Application.php b/apps/comments/lib/AppInfo/Application.php
index 8951387b362..db4a2ce614c 100644
--- a/apps/comments/lib/AppInfo/Application.php
+++ b/apps/comments/lib/AppInfo/Application.php
@@ -1,20 +1,19 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Comments\AppInfo;
-use Closure;
use OCA\Comments\Capabilities;
-use OCA\Comments\EventHandler;
use OCA\Comments\Listener\CommentsEntityEventListener;
+use OCA\Comments\Listener\CommentsEventListener;
use OCA\Comments\Listener\LoadAdditionalScripts;
use OCA\Comments\Listener\LoadSidebarScripts;
use OCA\Comments\MaxAutoCompleteResultsInitialState;
use OCA\Comments\Notification\Notifier;
use OCA\Comments\Search\CommentsSearchProvider;
-use OCA\Comments\Search\LegacyProvider;
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCA\Files\Event\LoadSidebar;
use OCP\AppFramework\App;
@@ -22,9 +21,7 @@ use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\Comments\CommentsEntityEvent;
-use OCP\Comments\ICommentsManager;
-use OCP\ISearch;
-use OCP\IServerContainer;
+use OCP\Comments\CommentsEvent;
class Application extends App implements IBootstrap {
public const APP_ID = 'comments';
@@ -48,6 +45,11 @@ class Application extends App implements IBootstrap {
CommentsEntityEvent::class,
CommentsEntityEventListener::class
);
+ $context->registerEventListener(
+ CommentsEvent::class,
+ CommentsEventListener::class,
+ );
+
$context->registerSearchProvider(CommentsSearchProvider::class);
$context->registerInitialStateProvider(MaxAutoCompleteResultsInitialState::class);
@@ -56,14 +58,5 @@ class Application extends App implements IBootstrap {
}
public function boot(IBootContext $context): void {
- $context->injectFn(Closure::fromCallable([$this, 'registerCommentsEventHandler']));
-
- $context->getServerContainer()->get(ISearch::class)->registerProvider(LegacyProvider::class, ['apps' => ['files']]);
- }
-
- protected function registerCommentsEventHandler(IServerContainer $container): void {
- $container->get(ICommentsManager::class)->registerEventHandler(function (): EventHandler {
- return $this->getContainer()->get(EventHandler::class);
- });
}
}