Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions apps/updatenotification/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ public function register() {
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) {
Expand Down