Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-04-09 13:25:35 +0300
committerJoas Schilling <coding@schilljs.com>2020-05-12 11:40:20 +0300
commite005b9cd6c821f1a41229460370c96f9ff7e310a (patch)
treec07ec57b43f6e938005b7b326eebf39caf8830d5 /lib/Config.php
parentac5b65c9700d9a319b92986ea9b309b8fab9f963 (diff)
Use a dedicated method to get the signaling mode
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Config.php')
-rw-r--r--lib/Config.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/Config.php b/lib/Config.php
index 3e63719a8..cc15539f0 100644
--- a/lib/Config.php
+++ b/lib/Config.php
@@ -32,6 +32,7 @@ class Config {
public const SIGNALING_INTERNAL = 'internal';
public const SIGNALING_EXTERNAL = 'external';
+ public const SIGNALING_CLUSTER_CONVERSATION = 'conversation_cluster';
/** @var IConfig */
protected $config;
@@ -235,10 +236,26 @@ class Config {
}
public function getSignalingMode(): string {
- if (empty($this->getSignalingServers())) {
+ $validModes = [
+ self::SIGNALING_INTERNAL,
+ self::SIGNALING_EXTERNAL,
+ self::SIGNALING_CLUSTER_CONVERSATION,
+ ];
+
+ $mode = $this->config->getAppValue('spreed', 'signaling_mode', null);
+ if ($mode === self::SIGNALING_INTERNAL) {
return self::SIGNALING_INTERNAL;
}
- return self::SIGNALING_EXTERNAL;
+
+ $numSignalingServers = count($this->getSignalingServers());
+ if ($numSignalingServers === 0) {
+ return self::SIGNALING_INTERNAL;
+ }
+ if ($numSignalingServers === 1) {
+ return self::SIGNALING_EXTERNAL;
+ }
+
+ return \in_array($mode, $validModes, true) ? $mode : self::SIGNALING_EXTERNAL;
}
/**