diff options
author | Georg Ehrke <georgehrke@users.noreply.github.com> | 2019-07-02 08:58:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-02 08:58:21 +0000 |
commit | 9f7fca49bbeb13104457d9f74645d3715f98789f (patch) | |
tree | 55687534362b63a1b318b2a36de00b1e463caf78 /core | |
parent | 9beda013c159e857113de1d9ab3314ed9c85d5f9 (diff) | |
parent | aa6622ccef610b4f3bfb57facb80e3e6613fd22e (diff) | |
download | nextcloud-server-9f7fca49bbeb13104457d9f74645d3715f98789f.tar.gz nextcloud-server-9f7fca49bbeb13104457d9f74645d3715f98789f.zip |
Merge pull request #15775 from nextcloud/refactor/decouple-remote-wipe-notifications
Decouple remote wipe notifcation channels with events
Diffstat (limited to 'core')
-rw-r--r-- | core/Application.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/core/Application.php b/core/Application.php index 967e3a62c1e..97ebae774dd 100644 --- a/core/Application.php +++ b/core/Application.php @@ -28,12 +28,18 @@ namespace OC\Core; +use OC\Authentication\Events\RemoteWipeFinished; +use OC\Authentication\Events\RemoteWipeStarted; +use OC\Authentication\Listeners\RemoteWipeActivityListener; +use OC\Authentication\Listeners\RemoteWipeNotificationsListener; use OC\Authentication\Notifications\Notifier as AuthenticationNotifier; use OC\Core\Notification\RemoveLinkSharesNotifier; use OC\DB\MissingIndexInformation; use OC\DB\SchemaWrapper; use OCP\AppFramework\App; +use OCP\EventDispatcher\IEventDispatcher; use OCP\IDBConnection; +use OCP\IServerContainer; use OCP\Util; use Symfony\Component\EventDispatcher\GenericEvent; @@ -54,7 +60,8 @@ class Application extends App { }); $server = $container->getServer(); - $eventDispatcher = $server->getEventDispatcher(); + /** @var IEventDispatcher $eventDispatcher */ + $eventDispatcher = $server->query(IEventDispatcher::class); $notificationManager = $server->getNotificationManager(); $notificationManager->registerNotifier(function() use ($server) { @@ -155,5 +162,10 @@ class Application extends App { } } ); + + $eventDispatcher->addServiceListener(RemoteWipeStarted::class, RemoteWipeActivityListener::class); + $eventDispatcher->addServiceListener(RemoteWipeStarted::class, RemoteWipeNotificationsListener::class); + $eventDispatcher->addServiceListener(RemoteWipeFinished::class, RemoteWipeActivityListener::class); + $eventDispatcher->addServiceListener(RemoteWipeFinished::class, RemoteWipeNotificationsListener::class); } } |