aboutsummaryrefslogtreecommitdiffstats
path: root/core/BackgroundJobs/LookupServerSendCheckBackgroundJob.php
blob: 01eec5b3ce1bbb07fc13702b316e5e3092c400d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php

declare(strict_types=1);

/**
 * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */
namespace OC\Core\BackgroundJobs;

use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\QueuedJob;
use OCP\IConfig;
use OCP\IUser;
use OCP\IUserManager;

class LookupServerSendCheckBackgroundJob extends QueuedJob {
	public function __construct(
		protected IConfig $config,
		private IUserManager $userManager,
		ITimeFactory $time,
	) {
		parent::__construct($time);
	}

	/**
	 * @param array $argument
	 */
	public function run($argument): void {
		$this->userManager->callForSeenUsers(function (IUser $user) {
			$this->config->setUserValue($user->getUID(), 'lookup_server_connector', 'dataSend', '1');
		});
	}
}