@@ -39,44 +39,44 @@ |
||
| 39 | 39 | use OCP\Util; |
| 40 | 40 | |
| 41 | 41 | class Application extends App implements IBootstrap { |
| 42 | - public function __construct() { |
|
| 43 | - parent::__construct('updatenotification', []); |
|
| 44 | - } |
|
| 42 | + public function __construct() { |
|
| 43 | + parent::__construct('updatenotification', []); |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - public function register(IRegistrationContext $context): void { |
|
| 47 | - } |
|
| 46 | + public function register(IRegistrationContext $context): void { |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - public function boot(IBootContext $context): void { |
|
| 50 | - $server = $context->getServerContainer(); |
|
| 49 | + public function boot(IBootContext $context): void { |
|
| 50 | + $server = $context->getServerContainer(); |
|
| 51 | 51 | |
| 52 | - if ($server->getConfig()->getSystemValue('updatechecker', true) !== true) { |
|
| 53 | - // Updater check is disabled |
|
| 54 | - return; |
|
| 55 | - } |
|
| 52 | + if ($server->getConfig()->getSystemValue('updatechecker', true) !== true) { |
|
| 53 | + // Updater check is disabled |
|
| 54 | + return; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - // Always register the notifier, so background jobs (without a user) can send push notifications |
|
| 58 | - $notificationsManager = $server->getNotificationManager(); |
|
| 59 | - $notificationsManager->registerNotifierService(Notifier::class); |
|
| 57 | + // Always register the notifier, so background jobs (without a user) can send push notifications |
|
| 58 | + $notificationsManager = $server->getNotificationManager(); |
|
| 59 | + $notificationsManager->registerNotifierService(Notifier::class); |
|
| 60 | 60 | |
| 61 | - $user = $server->getUserSession()->getUser(); |
|
| 62 | - if (!$user instanceof IUser) { |
|
| 63 | - // Nothing to do for guests |
|
| 64 | - return; |
|
| 65 | - } |
|
| 61 | + $user = $server->getUserSession()->getUser(); |
|
| 62 | + if (!$user instanceof IUser) { |
|
| 63 | + // Nothing to do for guests |
|
| 64 | + return; |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - if (!$server->getAppManager()->isEnabledForUser('notifications') && |
|
| 68 | - $server->getGroupManager()->isAdmin($user->getUID())) { |
|
| 69 | - try { |
|
| 70 | - $updateChecker = $server->query(UpdateChecker::class); |
|
| 71 | - } catch (QueryException $e) { |
|
| 72 | - $server->getLogger()->logException($e); |
|
| 73 | - return; |
|
| 74 | - } |
|
| 67 | + if (!$server->getAppManager()->isEnabledForUser('notifications') && |
|
| 68 | + $server->getGroupManager()->isAdmin($user->getUID())) { |
|
| 69 | + try { |
|
| 70 | + $updateChecker = $server->query(UpdateChecker::class); |
|
| 71 | + } catch (QueryException $e) { |
|
| 72 | + $server->getLogger()->logException($e); |
|
| 73 | + return; |
|
| 74 | + } |
|
| 75 | 75 | |
| 76 | - if ($updateChecker->getUpdateState() !== []) { |
|
| 77 | - Util::addScript('updatenotification', 'legacy-notification'); |
|
| 78 | - \OC_Hook::connect('\OCP\Config', 'js', $updateChecker, 'populateJavaScriptVariables'); |
|
| 79 | - } |
|
| 80 | - } |
|
| 81 | - } |
|
| 76 | + if ($updateChecker->getUpdateState() !== []) { |
|
| 77 | + Util::addScript('updatenotification', 'legacy-notification'); |
|
| 78 | + \OC_Hook::connect('\OCP\Config', 'js', $updateChecker, 'populateJavaScriptVariables'); |
|
| 79 | + } |
|
| 80 | + } |
|
| 81 | + } |
|
| 82 | 82 | } |