mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-06 13:57:57 +00:00
Make isTalkRecordingEnabled an attribute
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
d29829eebc
commit
7ba721cb61
5 changed files with 10 additions and 31 deletions
|
|
@ -88,6 +88,11 @@ class ConfigurationManager
|
|||
set { $this->set('isTalkEnabled', $value); }
|
||||
}
|
||||
|
||||
public bool $isTalkRecordingEnabled {
|
||||
get => $this->isTalkEnabled && $this->get('isTalkRecordingEnabled', false);
|
||||
set { $this->set('isTalkRecordingEnabled', $this->isTalkEnabled && $value); }
|
||||
}
|
||||
|
||||
public function GetConfig() : array
|
||||
{
|
||||
if ($this->config === [] && file_exists(DataConst::GetConfigFile()))
|
||||
|
|
@ -258,28 +263,6 @@ class ConfigurationManager
|
|||
$this->WriteConfig($config);
|
||||
}
|
||||
|
||||
public function isTalkRecordingEnabled() : bool {
|
||||
if (!$this->isTalkEnabled()) {
|
||||
return false;
|
||||
}
|
||||
$config = $this->GetConfig();
|
||||
if (isset($config['isTalkRecordingEnabled']) && $config['isTalkRecordingEnabled'] === 1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function SetTalkRecordingEnabledState(int $value) : void {
|
||||
if (!$this->isTalkEnabled()) {
|
||||
$value = 0;
|
||||
}
|
||||
|
||||
$config = $this->GetConfig();
|
||||
$config['isTalkRecordingEnabled'] = $value;
|
||||
$this->WriteConfig($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws InvalidSettingConfigurationException
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue