aboutsummaryrefslogtreecommitdiffstats
path: root/core/Application.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-05-28 17:56:01 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-06-27 17:16:18 +0200
commitaa6622ccef610b4f3bfb57facb80e3e6613fd22e (patch)
tree723d8be9abcdea889d931bc0dc3377d20d5dfd95 /core/Application.php
parentbc6053eb2119b462f78098d72d665aba744826cb (diff)
downloadnextcloud-server-aa6622ccef610b4f3bfb57facb80e3e6613fd22e.tar.gz
nextcloud-server-aa6622ccef610b4f3bfb57facb80e3e6613fd22e.zip
Decouple remote wipe notifcation channels with events
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'core/Application.php')
-rw-r--r--core/Application.php14
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);
}
}