Always register the Notifier
... so background jobs without a user can prepare push notifications Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
ff6f105ea6
commit
5eae69bd2d
|
@ -44,17 +44,17 @@ class Application extends App {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Always register the notifier, so background jobs (without a user) can send push notifications
|
||||||
|
$this->registerNotifier();
|
||||||
|
|
||||||
$user = $server->getUserSession()->getUser();
|
$user = $server->getUserSession()->getUser();
|
||||||
if (!$user instanceof IUser) {
|
if (!$user instanceof IUser) {
|
||||||
// Nothing to do for guests
|
// Nothing to do for guests
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($server->getAppManager()->isEnabledForUser('notifications')) {
|
if (!$server->getAppManager()->isEnabledForUser('notifications') &&
|
||||||
// Notifications app is available, so we register.
|
$server->getGroupManager()->isAdmin($user->getUID())) {
|
||||||
// Since notifications also work for non-admins we don't check this here.
|
|
||||||
$this->registerNotifier();
|
|
||||||
} else if ($server->getGroupManager()->isAdmin($user->getUID())) {
|
|
||||||
try {
|
try {
|
||||||
$updateChecker = $this->getContainer()->query(UpdateChecker::class);
|
$updateChecker = $this->getContainer()->query(UpdateChecker::class);
|
||||||
} catch (QueryException $e) {
|
} catch (QueryException $e) {
|
||||||
|
|
Loading…
Reference in New Issue