-
Notifications
You must be signed in to change notification settings - Fork 575
feat(settings): split default camera and microphone settings into separate toggles #19034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,6 +60,9 @@ class Config { | |
| public const string EXTERNAL_CALL_SERVICE_AUTH_USER = 'external_call_service_auth_user'; | ||
| public const string EXTERNAL_CALL_SERVICE_AUTH_PASSWORD = 'external_call_service_auth_password'; | ||
| public const string EXTERNAL_CALL_SERVICE_IFRAME_FIELD = 'external_call_service_iframe_field'; | ||
| public const string CALLS_START_WITHOUT_AUDIO = 'calls_start_without_audio'; | ||
| public const string CALLS_START_WITHOUT_VIDEO = 'calls_start_without_video'; | ||
| /** @deprecated Kept as fallback for existing installations. */ | ||
| public const string CALLS_START_WITHOUT_MEDIA = 'calls_start_without_media'; | ||
| public const string INACTIVITY_LOCK_AFTER_DAYS = 'inactivity_lock_after_days'; | ||
| public const string INACTIVITY_ENABLE_LOBBY = 'inactivity_enable_lobby'; | ||
|
|
@@ -872,14 +875,68 @@ public function getGridVideosLimitEnforced(): bool { | |
| * @param ?string $userId | ||
| * @return bool | ||
| */ | ||
| public function getCallsStartWithoutAudio(?string $userId): bool { | ||
| return $this->getCallsStartWithoutMediaType($userId, self::CALLS_START_WITHOUT_AUDIO); | ||
| } | ||
|
|
||
| public function getCallsStartWithoutVideo(?string $userId): bool { | ||
| return $this->getCallsStartWithoutMediaType($userId, self::CALLS_START_WITHOUT_VIDEO); | ||
| } | ||
|
|
||
| /** @deprecated Use getCallsStartWithoutAudio() and getCallsStartWithoutVideo(). */ | ||
| public function getCallsStartWithoutMedia(?string $userId): bool { | ||
| if ($userId !== null) { | ||
| $userSetting = $this->config->getUserValue($userId, 'spreed', UserPreference::CALLS_START_WITHOUT_MEDIA); | ||
| if ($userSetting === 'yes' || $userSetting === 'no') { | ||
| return $userSetting === 'yes'; | ||
| } | ||
|
|
||
| // If the legacy setting is not set, check the new settings for audio and video separately. | ||
| $audioSetting = $this->config->getUserValue($userId, 'spreed', UserPreference::CALLS_START_WITHOUT_AUDIO); | ||
| $videoSetting = $this->config->getUserValue($userId, 'spreed', UserPreference::CALLS_START_WITHOUT_VIDEO); | ||
| if ($audioSetting === 'yes' || $videoSetting === 'yes') { | ||
| return true; | ||
| } | ||
| if ($audioSetting === 'no' && $videoSetting === 'no') { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| $legacyAppSetting = $this->appConfig->getAppValue(self::CALLS_START_WITHOUT_MEDIA); | ||
| if ($legacyAppSetting !== '') { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
| return $legacyAppSetting === 'yes' || $legacyAppSetting === '1'; | ||
| } | ||
|
|
||
| // If the legacy setting is not set, check the new settings for audio and video separately. | ||
| $audioAppSetting = $this->appConfig->getAppValue(self::CALLS_START_WITHOUT_AUDIO); | ||
| $videoAppSetting = $this->appConfig->getAppValue(self::CALLS_START_WITHOUT_VIDEO); | ||
| if ($audioAppSetting !== '' || $videoAppSetting !== '') { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
| return $audioAppSetting === 'yes' || $audioAppSetting === '1' | ||
| || $videoAppSetting === 'yes' || $videoAppSetting === '1'; | ||
| } | ||
|
|
||
| return false; | ||
| } | ||
|
|
||
| private function getCallsStartWithoutMediaType(?string $userId, string $key): bool { | ||
| if ($userId !== null) { | ||
| $userSetting = $this->config->getUserValue($userId, 'spreed', $key); | ||
| if ($userSetting === 'yes' || $userSetting === 'no') { | ||
| return $userSetting === 'yes'; | ||
| } | ||
|
|
||
| // If the new setting is not set, check the legacy setting. | ||
| $legacyUserSetting = $this->config->getUserValue($userId, 'spreed', UserPreference::CALLS_START_WITHOUT_MEDIA); | ||
| if ($legacyUserSetting === 'yes' || $legacyUserSetting === 'no') { | ||
| return $legacyUserSetting === 'yes'; | ||
| } | ||
| } | ||
|
|
||
| if ($this->appConfig->getAppValue($key) !== '') { | ||
| return $this->appConfig->getAppValueBool($key); | ||
| } | ||
|
|
||
| // If the new setting is not set, check the legacy setting. | ||
| return $this->appConfig->getAppValueBool(self::CALLS_START_WITHOUT_MEDIA); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,7 +49,9 @@ public function getAppConfigs(): array { | |
| new Entry(Config::EXTERNAL_CALL_SERVICE_AUTH_PASSWORD, ValueType::STRING, '', definition: 'HTTP Basic Auth password used when Talk calls the external service'), | ||
| new Entry(Config::EXTERNAL_CALL_SERVICE_FRAME_ORIGINS, ValueType::ARRAY, [], definition: 'JSON array of scheme+host(+port) origins that may be loaded in the iframe.' . PHP_EOL . 'Added to `Content-Security-Policy: frame-src` and the `Permissions-Policy` for camera/microphone'), | ||
| new Entry(Config::EXTERNAL_CALL_SERVICE_IFRAME_FIELD, ValueType::STRING, '', definition: 'JSON field name in the external service response that contains the iframe URL'), | ||
| new Entry(Config::CALLS_START_WITHOUT_MEDIA, ValueType::BOOL, false, definition: 'Whether participants start with enabled or disabled audio and video by default'), | ||
| new Entry(Config::CALLS_START_WITHOUT_MEDIA, ValueType::BOOL, false, definition: 'Deprecated: whether participants start with audio and video disabled by default', deprecated: true), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should mention what to check instead |
||
| new Entry(Config::CALLS_START_WITHOUT_AUDIO, ValueType::BOOL, false, definition: 'Whether participants start with audio disabled by default'), | ||
| new Entry(Config::CALLS_START_WITHOUT_VIDEO, ValueType::BOOL, false, definition: 'Whether participants start with video disabled by default'), | ||
| new Entry(Config::INACTIVITY_LOCK_AFTER_DAYS, ValueType::INT, 0, definition: 'A duration (in days) after which rooms are locked. Calculated from the last activity in the room,'), | ||
| new Entry(Config::INACTIVITY_ENABLE_LOBBY, ValueType::BOOL, false, definition: 'Additionally enable the lobby for inactive rooms so they can only be read by moderators.'), | ||
| new Entry(Config::EXPERIMENTS_USERS, ValueType::INT, 0, definition: 'Bit flag of experiments that should be enabled for logged-in users on this server' . PHP_EOL . 'See https://github.com/nextcloud/spreed/blob/main/docs/settings.md#experiments'), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -793,6 +793,8 @@ | |
| * can-enable-sip: bool, | ||
| * // Whether calls start without media by default | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should mention the deprecation and what to check instead |
||
| * start-without-media: bool, | ||
| * start-without-audio: bool, | ||
| * start-without-video: bool, | ||
|
Comment on lines
+796
to
+797
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both should have docs. |
||
| * // Maximum duration of a call in seconds, `0` means unlimited | ||
| * max-duration: int, | ||
| * // Whether the blur virtual background is available | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should mention what should be checked instead