@@ -32,6 +32,7 @@ use OCA\Deck\NoPermissionException;
|
|||||||
use OCP\IConfig;
|
use OCP\IConfig;
|
||||||
use OCP\IGroup;
|
use OCP\IGroup;
|
||||||
use OCP\IGroupManager;
|
use OCP\IGroupManager;
|
||||||
|
use OCP\IUserSession;
|
||||||
|
|
||||||
class ConfigService {
|
class ConfigService {
|
||||||
public const SETTING_BOARD_NOTIFICATION_DUE_OFF = 'off';
|
public const SETTING_BOARD_NOTIFICATION_DUE_OFF = 'off';
|
||||||
@@ -46,9 +47,10 @@ class ConfigService {
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
IConfig $config,
|
IConfig $config,
|
||||||
IGroupManager $groupManager,
|
IGroupManager $groupManager,
|
||||||
$userId
|
IUserSession $userSession
|
||||||
) {
|
) {
|
||||||
$this->userId = $userId;
|
// Session is required here in order to make the tests properly inject the userId later on
|
||||||
|
$this->userId = $userSession->getUser() ? $userSession->getUser()->getUID() : null;
|
||||||
$this->groupManager = $groupManager;
|
$this->groupManager = $groupManager;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,12 +37,9 @@ class Listener {
|
|||||||
|
|
||||||
/** @var ConfigService */
|
/** @var ConfigService */
|
||||||
private $configService;
|
private $configService;
|
||||||
/** @var string|null */
|
|
||||||
private $userId;
|
|
||||||
|
|
||||||
public function __construct(ConfigService $configService, $userId) {
|
public function __construct(ConfigService $configService) {
|
||||||
$this->configService = $configService;
|
$this->configService = $configService;
|
||||||
$this->userId = $userId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function register(IEventDispatcher $dispatcher): void {
|
public function register(IEventDispatcher $dispatcher): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user