Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@
* `chat-summary-api` (local) - Whether the endpoint to get summarized chat messages in a conversation is available
* `email-csv-import` - Whether the endpoint to import a CSV email list as participants exists
* `config => chat => summary-threshold` (local) - Number of unread messages that should exist to show a "Generate summary" option
* `config => call => start-without-media` (local) - Boolean, whether media should be disabled when starting or joining a conversation
* `config => call => start-without-audio` (local) - Boolean, whether audio should be disabled when starting or joining a conversation
* `config => call => start-without-video` (local) - Boolean, whether video should be disabled when starting or joining a conversation
* `config => call => max-duration` - Integer, maximum call duration in seconds. Please note that this should only be used with system cron and with a reasonable high value, due to the expended duration until the background job ran.
* `config => call => blur-virtual-background` (local) - Boolean, whether blur background is set by default when joining a conversation

Expand Down
8 changes: 5 additions & 3 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

## User settings

**Note:** Settings from `calls_start_without_media` onwards can not be set via above API.
**Note:** Settings from `calls_start_without_audio` onwards can not be set via above API.
Instead, the server API `POST /ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}/{configKey}` needs to be used.

| Key | Capability | Default | Valid values |
Expand All @@ -30,7 +30,8 @@ Instead, the server API `POST /ocs/v2.php/apps/provisioning_api/api/v1/config/us
| `read_status_privacy` | `config => chat => read-privacy` | `0` | One of the read-status constants from the [constants list](constants.md#participant-read-status-privacy) |
| `typing_privacy` | `config => chat => typing-privacy` | `0` | One of the typing privacy constants from the [constants list](constants.md#participant-typing-privacy) |
| `play_sounds` | | `'yes'` | `'yes'` and `'no'` |
| `calls_start_without_media` | `config => call => start-without-media` | `''` falling back to app config with the same name | `'yes'` and `'no'` |
| `calls_start_without_audio` | `config => call => start-without-audio` | `''` falling back to app config with the same name | `'yes'` and `'no'` |
| `calls_start_without_video` | `config => call => start-without-video` | `''` falling back to app config with the same name | `'yes'` and `'no'` |
| `blur_virtual_background` | `config => call => blur-virtual-background` | `'no'` | `'yes'` and `'no'` |
| `conversations_list_style` | `config => conversations => list-style` | `''` falling back to app config with the same name | One of the constants from the [constants list](constants.md#conversation-list-style) |
| `chat_style` | `config => chat => chat-style` | `''` falling back to app config with the same name | One of the constants from the [constants list](constants.md#chat-style) |
Expand Down Expand Up @@ -117,7 +118,8 @@ Legend:
| `hide_signaling_warning` | string<br>`yes` or `no` | `no` | No | 🖌️ | Flag that allows to suppress the warning that an HPB should be configured |
| `conversations_list_style` | string<br>`two-lines` or `compact` | `two-lines` | No | | Default conversation list style when not overwritten by the user |
| `chat_style` | string<br>`split` or `unified` | `split` | No | | Default chat style when not overwritten by the user |
| `calls_start_without_media` | bool | `false` | No | | Whether participants start with enabled or disabled audio and video by default |
| `calls_start_without_audio` | bool | `false` | No | | Whether participants start with audio disabled by default |
| `calls_start_without_video` | bool | `false` | No | | Whether participants start with video disabled by default |
| `breakout_rooms` | bool | `true` | Yes | | Whether or not breakout rooms are allowed (Will only prevent creating new breakout rooms. Existing conversations are not modified.) |
| `call_recording` | string<br>`yes` or `no` | `yes` | Yes | | Enable call recording |
| `call_recording_summary` | string<br>`yes` or `no` | `yes` | No | 🖌️ | Whether call recordings should automatically be summarized when a transcription and summary provider is enabled. |
Expand Down
6 changes: 4 additions & 2 deletions lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ class Capabilities implements IPublicCapability {
'predefined-backgrounds',
'predefined-backgrounds-v2',
'can-upload-background',
'start-without-media',
'start-without-audio',
'start-without-video',
'blur-virtual-background',
'live-transcription-target-language-id',
'play-sounds',
Expand Down Expand Up @@ -290,7 +291,8 @@ public function getCapabilities(): array {
'sip-dialout-enabled' => $this->talkConfig->isSIPDialOutEnabled(),
'default-phone-region' => $this->serverConfig->getSystemValueString('default_phone_region'),
'can-enable-sip' => false,
'start-without-media' => $this->talkConfig->getCallsStartWithoutMedia($user?->getUID()),
'start-without-audio' => $this->talkConfig->getCallsStartWithoutAudio($user?->getUID()),
'start-without-video' => $this->talkConfig->getCallsStartWithoutVideo($user?->getUID()),
'max-duration' => $this->appConfig->getAppValueInt('max_call_duration'),
'blur-virtual-background' => $this->talkConfig->getBlurVirtualBackground($user?->getUID()),
'end-to-end-encryption' => $this->talkConfig->isCallEndToEndEncryptionEnabled(),
Expand Down
25 changes: 23 additions & 2 deletions lib/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -872,12 +875,30 @@ public function getGridVideosLimitEnforced(): bool {
* @param ?string $userId
* @return bool
*/
public function getCallsStartWithoutMedia(?string $userId): 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);
}

private function getCallsStartWithoutMediaType(?string $userId, string $key): bool {
if ($userId !== null) {
$userSetting = $this->config->getUserValue($userId, 'spreed', UserPreference::CALLS_START_WITHOUT_MEDIA);
$userSetting = $this->config->getUserValue($userId, 'spreed', $key);
if ($userSetting === 'yes' || $userSetting === 'no') {
return $userSetting === 'yes';
}

// Legacy setting for backward compatibility
$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);
}

return $this->appConfig->getAppValueBool(self::CALLS_START_WITHOUT_MEDIA);
Expand Down
3 changes: 2 additions & 1 deletion lib/ConfigLexicon.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ 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_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'),
Expand Down
7 changes: 5 additions & 2 deletions lib/Controller/RoomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3373,8 +3373,11 @@ public function getCapabilities(): DataResponse {
if (isset($data['config']['chat']['typing-privacy'])) {
$data['config']['chat']['typing-privacy'] = $this->talkConfig->getUserTypingPrivacy($this->userId);
}
if (isset($data['config']['call']['start-without-media'])) {
$data['config']['call']['start-without-media'] = $this->talkConfig->getCallsStartWithoutMedia($this->userId);
if (isset($data['config']['call']['start-without-audio'])) {
$data['config']['call']['start-without-audio'] = $this->talkConfig->getCallsStartWithoutAudio($this->userId);
}
if (isset($data['config']['call']['start-without-video'])) {
$data['config']['call']['start-without-video'] = $this->talkConfig->getCallsStartWithoutVideo($this->userId);
}
if (isset($data['config']['call']['blur-virtual-background'])) {
$data['config']['call']['blur-virtual-background'] = $this->talkConfig->getBlurVirtualBackground($this->userId);
Expand Down
3 changes: 2 additions & 1 deletion lib/ResponseDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,8 @@
* // Whether the user can enable SIP for conversations
* can-enable-sip: bool,
* // Whether calls start without media by default

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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
Expand Down
4 changes: 3 additions & 1 deletion lib/Settings/BeforePreferenceSetEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ public function validatePreference(string $userId, string $key, string|int|null
}

// "boolean" yes/no
if ($key === UserPreference::CALLS_START_WITHOUT_MEDIA
if ($key === UserPreference::CALLS_START_WITHOUT_AUDIO
|| $key === UserPreference::CALLS_START_WITHOUT_VIDEO
|| $key === UserPreference::CALLS_START_WITHOUT_MEDIA
|| $key === UserPreference::PLAY_SOUNDS
|| $key === UserPreference::BLUR_VIRTUAL_BACKGROUND) {
return $value === 'yes' || $value === 'no';
Expand Down
3 changes: 3 additions & 0 deletions lib/Settings/UserPreference.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
class UserPreference {
public const ATTACHMENT_FOLDER = 'attachment_folder';
public const BLUR_VIRTUAL_BACKGROUND = 'blur_virtual_background';
public const CALLS_START_WITHOUT_AUDIO = 'calls_start_without_audio';
public const CALLS_START_WITHOUT_VIDEO = 'calls_start_without_video';
/** @deprecated Kept as fallback for existing installations. */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/** @deprecated Kept as fallback for existing installations. */
#[\Deprecated(message: 'Check individual configs for audio and video instead', since: '26.0.0')]

public const CALLS_START_WITHOUT_MEDIA = 'calls_start_without_media';
public const CONVERSATIONS_LIST_STYLE = 'conversations_list_style';
public const CHAT_STYLE = 'chat_style';
Expand Down
11 changes: 8 additions & 3 deletions openapi-administration.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@
"sip-dialout-enabled",
"default-phone-region",
"can-enable-sip",
"start-without-media",
"start-without-audio",
"start-without-video",
"max-duration",
"blur-virtual-background",
"end-to-end-encryption",
Expand Down Expand Up @@ -244,9 +245,13 @@
"type": "boolean",
"description": "Whether the user can enable SIP for conversations"
},
"start-without-media": {
"start-without-audio": {
"type": "boolean",
"description": "Whether calls start without media by default"
"description": "Whether calls start without audio by default"
},
"start-without-video": {
"type": "boolean",
"description": "Whether calls start without video by default"
},
"max-duration": {
"type": "integer",
Expand Down
11 changes: 8 additions & 3 deletions openapi-backend-recording.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
"sip-dialout-enabled",
"default-phone-region",
"can-enable-sip",
"start-without-media",
"start-without-audio",
"start-without-video",
"max-duration",
"blur-virtual-background",
"end-to-end-encryption",
Expand Down Expand Up @@ -167,9 +168,13 @@
"type": "boolean",
"description": "Whether the user can enable SIP for conversations"
},
"start-without-media": {
"start-without-audio": {
"type": "boolean",
"description": "Whether calls start without media by default"
"description": "Whether calls start without audio by default"
},
"start-without-video": {
"type": "boolean",
"description": "Whether calls start without video by default"
},
"max-duration": {
"type": "integer",
Expand Down
11 changes: 8 additions & 3 deletions openapi-backend-signaling.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
"sip-dialout-enabled",
"default-phone-region",
"can-enable-sip",
"start-without-media",
"start-without-audio",
"start-without-video",
"max-duration",
"blur-virtual-background",
"end-to-end-encryption",
Expand Down Expand Up @@ -167,9 +168,13 @@
"type": "boolean",
"description": "Whether the user can enable SIP for conversations"
},
"start-without-media": {
"start-without-audio": {
"type": "boolean",
"description": "Whether calls start without media by default"
"description": "Whether calls start without audio by default"
},
"start-without-video": {
"type": "boolean",
"description": "Whether calls start without video by default"
},
"max-duration": {
"type": "integer",
Expand Down
Loading