diff options
author | Joas Schilling <coding@schilljs.com> | 2019-03-19 10:52:52 +0300 |
---|---|---|
committer | Backportbot <backportbot-noreply@rullzer.com> | 2019-03-19 18:43:38 +0300 |
commit | b0938d7d0dd019d3035857dedaf29ac05bf7fb9f (patch) | |
tree | 1d9be92571a30578cb16d2564a571a49c374d679 /apps/updatenotification | |
parent | 3c76c0ce1130b0f6bff6a361182493513a348018 (diff) |
Always register the Notifier
... so background jobs without a user can prepare push notifications
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/updatenotification')
-rw-r--r-- | apps/updatenotification/lib/AppInfo/Application.php | 10 |
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) { |