Publish the signaling mode as initial state

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-04-29 13:47:15 +02:00
Родитель 39ad6a9fab
Коммит 54791de3b3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 7076EA9751AACDDA
2 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -30,6 +30,9 @@ use OCP\Security\ISecureRandom;
class Config {
public const SIGNALING_INTERNAL = 'internal';
public const SIGNALING_EXTERNAL = 'external';
/** @var IConfig */
protected $config;
/** @var ITimeFactory */
@ -274,6 +277,13 @@ class Config {
);
}
public function getSignalingMode(): string {
if (empty($this->getSignalingServers())) {
return self::SIGNALING_INTERNAL;
}
return self::SIGNALING_EXTERNAL;
}
/**
* Returns list of signaling servers. Each entry contains the URL of the
* server and a flag whether the certificate should be verified.

Просмотреть файл

@ -49,6 +49,11 @@ trait TInitialState {
'talk', 'prefer_h264',
$this->serverConfig->getAppValue('spreed', 'prefer_h264', 'no') === 'yes'
);
$this->initialStateService->provideInitialState(
'talk', 'signaling_mode',
$this->talkConfig->getSignalingMode()
);
}
protected function publishInitialStateForUser(IUser $user, IRootFolder $rootFolder, IAppManager $appManager): void {