Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-10-29 22:15:04 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-10-30 11:57:07 +0300
commit5e496cd2e8d90d4e7947fbcfa6132ef5db744315 (patch)
tree483215beb01b088c9bd9b42b5e5d6b4e1664b7c3 /apps/files_sharing/lib
parent7ef3c95fa343d7d159958c843436183a1cbf252f (diff)
Fix invalid usages of the new dispatcher
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/AppInfo/Application.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php
index 6448d0fab4d..fd71f58f121 100644
--- a/apps/files_sharing/lib/AppInfo/Application.php
+++ b/apps/files_sharing/lib/AppInfo/Application.php
@@ -59,6 +59,7 @@ use OCP\IServerContainer;
use OCP\Share\Events\ShareCreatedEvent;
use OCP\Util;
use Psr\Container\ContainerInterface;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
class Application extends App {
@@ -74,6 +75,7 @@ class Application extends App {
/** @var IEventDispatcher $dispatcher */
$dispatcher = $container->query(IEventDispatcher::class);
+ $oldDispatcher = $container->getServer()->getEventDispatcher();
$mountProviderCollection = $server->getMountProviderCollection();
$notifications = $server->getNotificationManager();
@@ -124,7 +126,7 @@ class Application extends App {
$notifications->registerNotifierService(Notifier::class);
$this->registerMountProviders($mountProviderCollection);
- $this->registerEventsScripts($dispatcher);
+ $this->registerEventsScripts($dispatcher, $oldDispatcher);
$this->setupSharingMenus();
/**
@@ -138,7 +140,7 @@ class Application extends App {
$mountProviderCollection->registerProvider($this->getContainer()->query('ExternalMountProvider'));
}
- protected function registerEventsScripts(IEventDispatcher $dispatcher) {
+ protected function registerEventsScripts(IEventDispatcher $dispatcher, EventDispatcherInterface $oldDispatcher) {
// sidebar and files scripts
$dispatcher->addServiceListener(LoadAdditionalScriptsEvent::class, LoadAdditionalListener::class);
$dispatcher->addServiceListener(BeforeTemplateRenderedEvent::class, LegacyBeforeTemplateRenderedListener::class);
@@ -151,12 +153,12 @@ class Application extends App {
$dispatcher->addServiceListener(UserAddedEvent::class, UserAddedToGroupListener::class);
// notifications api to accept incoming user shares
- $dispatcher->addListener('OCP\Share::postShare', function (GenericEvent $event) {
+ $oldDispatcher->addListener('OCP\Share::postShare', function (GenericEvent $event) {
/** @var Listener $listener */
$listener = $this->getContainer()->query(Listener::class);
$listener->shareNotification($event);
});
- $dispatcher->addListener(IGroup::class . '::postAddUser', function (GenericEvent $event) {
+ $oldDispatcher->addListener(IGroup::class . '::postAddUser', function (GenericEvent $event) {
/** @var Listener $listener */
$listener = $this->getContainer()->query(Listener::class);
$listener->userAddedToGroup($event);