Merge pull request #14783 from nextcloud/backport/14744/stable14

[stable14] Always register the Notifier
This commit is contained in:
Roeland Jago Douma 2019-03-21 15:47:48 +01:00 committed by GitHub
commit d072bb16e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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