Always register the Notifier

... so background jobs without a user can prepare push notifications

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/14749/head
Joas Schilling 2019-03-19 08:52:52 +07:00 committed by Backportbot
parent 3c76c0ce11
commit b0938d7d0d
1 changed files with 5 additions and 5 deletions

@ -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) {