瀏覽代碼

Always register the Notifier

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

Signed-off-by: Joas Schilling <coding@schilljs.com>
tags/v16.0.0beta1
Joas Schilling 5 年之前
父節點
當前提交
5eae69bd2d
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 5 行新增5 行删除
  1. 5
    5
      apps/updatenotification/lib/AppInfo/Application.php

+ 5
- 5
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) {

Loading…
取消
儲存