fix(settings): Don't warn about missing optional future feature

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2025-11-20 20:12:22 +01:00
parent 0fa77c27d7
commit b681a06ce4
No known key found for this signature in database
GPG key ID: F72FA5B49FFA96B0
2 changed files with 20 additions and 3 deletions

View file

@ -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;
@ -790,6 +794,14 @@ class Config {
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');
}

View file

@ -185,11 +185,16 @@ class Manager {
$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 {