From 5eae69bd2d73bc3ec6b60e2c1eaecb70faa019cc Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 19 Mar 2019 08:52:52 +0100 Subject: [PATCH] Always register the Notifier ... so background jobs without a user can prepare push notifications Signed-off-by: Joas Schilling --- apps/updatenotification/lib/AppInfo/Application.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/updatenotification/lib/AppInfo/Application.php b/apps/updatenotification/lib/AppInfo/Application.php index 369b6e3f07d..14512bae838 100644 --- a/apps/updatenotification/lib/AppInfo/Application.php +++ b/apps/updatenotification/lib/AppInfo/Application.php @@ -44,17 +44,17 @@ class Application extends App { return; } + // Always register the notifier, so background jobs (without a user) can send push notifications + $this->registerNotifier(); + $user = $server->getUserSession()->getUser(); if (!$user instanceof IUser) { // Nothing to do for guests return; } - if ($server->getAppManager()->isEnabledForUser('notifications')) { - // Notifications app is available, so we register. - // Since notifications also work for non-admins we don't check this here. - $this->registerNotifier(); - } else if ($server->getGroupManager()->isAdmin($user->getUID())) { + if (!$server->getAppManager()->isEnabledForUser('notifications') && + $server->getGroupManager()->isAdmin($user->getUID())) { try { $updateChecker = $this->getContainer()->query(UpdateChecker::class); } catch (QueryException $e) {