From 8a0cb947f59bf762c593516b80199e5ce0b124d1 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Sat, 5 Nov 2022 02:27:55 +0100 Subject: [PATCH] Resolve #627 --- .../snappymail/lib/AppInfo/Application.php | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/integrations/nextcloud/snappymail/lib/AppInfo/Application.php b/integrations/nextcloud/snappymail/lib/AppInfo/Application.php index 5f0b883de..55b92449a 100644 --- a/integrations/nextcloud/snappymail/lib/AppInfo/Application.php +++ b/integrations/nextcloud/snappymail/lib/AppInfo/Application.php @@ -68,22 +68,9 @@ class Application extends App implements IBootstrap if (!\is_dir(\rtrim(\trim(\OC::$server->getSystemConfig()->getValue('datadirectory', '')), '\\/') . '/appdata_snappymail')) { return; } -/* - $container = $this->getContainer(); - $container->query('OCP\INavigationManager')->add(function () use ($container) { - $urlGenerator = $container->query('OCP\IURLGenerator'); - return [ - 'id' => 'snappymail', - 'order' => 4, - 'href' => $urlGenerator->linkToRoute('snappymail.page.index'), - 'icon' => $urlGenerator->imagePath('snappymail', 'logo-white-64x64.png'), - 'name' => \OCP\Util::getL10N('snappymail')->t('Email') - ]; - }); -*/ - $dispatcher = $container->query('OCP\EventDispatcher\IEventDispatcher'); - $this->dispatcher->addListener(PostLoginEvent::class, function (PostLoginEvent $Event) { + $dispatcher = $context->getAppContainer()->query('OCP\EventDispatcher\IEventDispatcher'); + $dispatcher->addListener(PostLoginEvent::class, function (PostLoginEvent $Event) { $config = \OC::$server->getConfig(); // Only store the user's password in the current session if they have // enabled auto-login using Nextcloud username or email address. @@ -95,7 +82,7 @@ class Application extends App implements IBootstrap } }); - $this->dispatcher->addListener(BeforeUserLoggedOutEvent::class, function (BeforeUserLoggedOutEvent $Event) { + $dispatcher->addListener(BeforeUserLoggedOutEvent::class, function (BeforeUserLoggedOutEvent $Event) { \OC::$server->getSession()['snappymail-password'] = ''; SnappyMailHelper::loadApp(); \RainLoop\Api::Actions()->Logout(true);