summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2019-03-19 16:42:54 +0100
committerGitHub <noreply@github.com>2019-03-19 16:42:54 +0100
commitaf03d3a491f5e8bee8d7038315a5a2a90e9ef41f (patch)
treec599376a3bae025d165e59a02699d043d3b3f2d5
parent04bc272c728f0f193ea8c86f0127c8a02dfaf545 (diff)
parent5eae69bd2d73bc3ec6b60e2c1eaecb70faa019cc (diff)
downloadnextcloud-server-af03d3a491f5e8bee8d7038315a5a2a90e9ef41f.tar.gz
nextcloud-server-af03d3a491f5e8bee8d7038315a5a2a90e9ef41f.zip
Merge pull request #14744 from nextcloud/bugfix/noid/fix-push-notifications-for-updatenotifications
Always register the Notifier
-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) {