diff --git a/lib/Config.php b/lib/Config.php index 59b45ed3ae8..ba74999ad3b 100644 --- a/lib/Config.php +++ b/lib/Config.php @@ -30,6 +30,10 @@ class Config { public const SIGNALING_EXTERNAL = 'external'; public const SIGNALING_CLUSTER_CONVERSATION = 'conversation_cluster'; + public const EXPERIMENTAL_UPDATE_PARTICIPANTS = 1; + public const EXPERIMENTAL_RECOVER_SESSION = 2; + public const EXPERIMENTAL_CHAT_RELAY = 4; + public const SIGNALING_TICKET_V1 = 1; public const SIGNALING_TICKET_V2 = 2; @@ -770,6 +774,14 @@ public function enableLobbyOnLockedRooms(): bool { return $this->appConfig->getAppValueBool('inactivity_enable_lobby'); } + /** + * @param self::EXPERIMENTAL_* $experiment + */ + public function hasExperiment(int $experiment): bool { + return $this->appConfig->getAppValueInt('experiments_users') & $experiment + || $this->appConfig->getAppValueInt('experiments_guests') & $experiment; + } + public function isPasswordEnforced(): bool { return $this->appConfig->getAppValueBool('force_passwords'); } diff --git a/lib/Signaling/Manager.php b/lib/Signaling/Manager.php index c6e031cb05a..55824686855 100644 --- a/lib/Signaling/Manager.php +++ b/lib/Signaling/Manager.php @@ -185,11 +185,16 @@ public function getSignalingServerMissingFeatures(IResponse $response): array { $features = explode(',', $featureHeader); $features = array_map('trim', $features); - return array_values(array_diff([ + $optionFeatures = [ 'dialout', 'join-features', - 'chat-relay', - ], $features)); + ]; + + if ($this->talkConfig->hasExperiment(Config::EXPERIMENTAL_CHAT_RELAY)) { + $optionFeatures[] = 'chat-relay'; + } + + return array_values(array_diff($optionFeatures, $features)); } public function getSignalingServerLinkForConversation(?Room $room): string {