aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-03-19 08:52:52 +0100
committerJoas Schilling <coding@schilljs.com>2019-03-19 08:54:05 +0100
commit5eae69bd2d73bc3ec6b60e2c1eaecb70faa019cc (patch)
treec80a7b135f5126d35b723b53434efbc2973726e7
parentff6f105ea6a37107e7c6e12bcace010490c93c58 (diff)
downloadnextcloud-server-5eae69bd2d73bc3ec6b60e2c1eaecb70faa019cc.tar.gz
nextcloud-server-5eae69bd2d73bc3ec6b60e2c1eaecb70faa019cc.zip
Always register the Notifier
... so background jobs without a user can prepare push notifications Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--apps/updatenotification/lib/AppInfo/Application.php10
1 files 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) {