diff options
author | Joas Schilling <coding@schilljs.com> | 2020-04-15 16:26:52 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-05-12 11:40:20 +0300 |
commit | bbcb75c589c9a2f52a4fa035fa76ec0a82e9eee8 (patch) | |
tree | a1b0a04506c354c281149be892ec4540233555fc /lib/TInitialState.php | |
parent | bf5489fefe41e66d7fdedee6a70b4f7d53fed354 (diff) |
Require a distributed MemCache
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/TInitialState.php')
-rw-r--r-- | lib/TInitialState.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/TInitialState.php b/lib/TInitialState.php index 7452436de..6004f7538 100644 --- a/lib/TInitialState.php +++ b/lib/TInitialState.php @@ -23,10 +23,12 @@ declare(strict_types=1); namespace OCA\Talk; +use OC\HintException; use OC\User\NoUserException; use OCP\App\IAppManager; use OCP\Files\IRootFolder; use OCP\Files\NotPermittedException; +use OCP\ICacheFactory; use OCP\IConfig; use OCP\IInitialStateService; use OCP\IUser; @@ -40,6 +42,8 @@ trait TInitialState { protected $serverConfig; /** @var IInitialStateService */ protected $initialStateService; + /** @var ICacheFactory */ + protected $memcacheFactory; protected function publishInitialStateShared(): void { // Needed to enable the screensharing extension in Chromium < 72. @@ -50,6 +54,13 @@ trait TInitialState { $this->serverConfig->getAppValue('spreed', 'prefer_h264', 'no') === 'yes' ); + $signalingMode = $this->talkConfig->getSignalingMode(); + if ($signalingMode !== 'internal' && !$this->memcacheFactory->isAvailable()) { + throw new HintException( + 'External signaling is only supported with a distributed cache' + ); + } + $this->initialStateService->provideInitialState( 'talk', 'signaling_mode', $this->talkConfig->getSignalingMode() |