Skip to content

Commit

Permalink
fix: rename blur-background to blur-virtual-background
Browse files Browse the repository at this point in the history
Signed-off-by: DorraJaouad <dorra.jaoued7@gmail.com>
  • Loading branch information
DorraJaouad committed Nov 11, 2024
1 parent 43a27db commit b97a870
Show file tree
Hide file tree
Showing 32 changed files with 66 additions and 49 deletions.
2 changes: 1 addition & 1 deletion docs/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@
* `download-call-participants` - Whether the endpoints for moderators to download the call participants is available
* `config => call => start-without-media` (local) - Boolean, whether media 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-background` (local) - Boolean, whether blur background is set by default when joining a conversation
* `config => call => blur-virtual-background` (local) - Boolean, whether blur background is set by default when joining a conversation
2 changes: 1 addition & 1 deletion docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Instead, the server API `POST /ocs/v2.php/apps/provisioning_api/api/v1/config/us
| `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'` |
| `blur_background` | `config => call => blur-background` | `'no'` | `'yes'` and `'no'` |
| `blur_virtual_background` | `config => call => blur-virtual-background` | `'no'` | `'yes'` and `'no'` |

## Set SIP settings

Expand Down
6 changes: 3 additions & 3 deletions lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class Capabilities implements IPublicCapability {
'predefined-backgrounds',
'can-upload-background',
'start-without-media',
'blur-background',
'blur-virtual-background',
],
'chat' => [
'read-privacy',
Expand Down Expand Up @@ -202,7 +202,7 @@ public function getCapabilities(): array {
'can-enable-sip' => false,
'start-without-media' => $this->talkConfig->getCallsStartWithoutMedia($user?->getUID()),
'max-duration' => $this->appConfig->getAppValueInt('max_call_duration'),
'blur-background' => $this->talkConfig->getBlurBackground($user?->getUID()),
'blur-virtual-background' => $this->talkConfig->getBlurBackground($user?->getUID()),
],
'chat' => [
'max-length' => ChatManager::MAX_CHAT_LENGTH,
Expand Down Expand Up @@ -252,7 +252,7 @@ public function getCapabilities(): array {
$capabilities['config']['attachments']['folder'] = $this->talkConfig->getAttachmentFolder($user->getUID());
$capabilities['config']['chat']['read-privacy'] = $this->talkConfig->getUserReadPrivacy($user->getUID());
$capabilities['config']['chat']['typing-privacy'] = $this->talkConfig->getUserTypingPrivacy($user->getUID());
$capabilities['config']['call']['blur-background'] = $this->talkConfig->getBlurBackground($user->getUID());
$capabilities['config']['call']['blur-virtual-background'] = $this->talkConfig->getBlurBackground($user->getUID());
}

$pubKey = $this->talkConfig->getSignalingTokenPublicKey();
Expand Down
2 changes: 1 addition & 1 deletion lib/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ public function getCallsStartWithoutMedia(?string $userId): bool {
*/
public function getBlurBackground(?string $userId): bool {
if ($userId !== null) {
$userSetting = $this->config->getUserValue($userId, 'spreed', UserPreference::BLUR_BACKGROUND);
$userSetting = $this->config->getUserValue($userId, 'spreed', UserPreference::BLUR_VIRTUAL_BACKGROUND);
return $userSetting === 'yes';
}
return false;
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/RoomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2458,8 +2458,8 @@ public function getCapabilities(): DataResponse {
if (isset($data['config']['call']['start-without-media'])) {
$data['config']['call']['start-without-media'] = $this->talkConfig->getCallsStartWithoutMedia($this->userId);
}
if (isset($data['config']['call']['blur-background'])) {
$data['config']['call']['blur-background'] = $this->talkConfig->getBlurBackground($this->userId);
if (isset($data['config']['call']['blur-virtual-background'])) {
$data['config']['call']['blur-virtual-background'] = $this->talkConfig->getBlurBackground($this->userId);
}

if ($response->getHeaders()['X-Nextcloud-Talk-Hash']) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Federation/Proxy/TalkV1/ProxyRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function overwrittenRemoteTalkHash(string $hash): string {
'typing-privacy',
],
'call' => [
'blur-background',
'blur-virtual-background',
]
],
]
Expand Down
2 changes: 1 addition & 1 deletion lib/ResponseDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
* can-enable-sip: bool,
* start-without-media: bool,
* max-duration: int,
* blur-background: bool,
* blur-virtual-background: bool,
* },
* chat: array{
* max-length: int,
Expand Down
2 changes: 1 addition & 1 deletion lib/Settings/BeforePreferenceSetEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function validatePreference(string $userId, string $key, string|int|null
// "boolean" yes/no
if ($key === UserPreference::CALLS_START_WITHOUT_MEDIA
|| $key === UserPreference::PLAY_SOUNDS
|| $key === UserPreference::BLUR_BACKGROUND) {
|| $key === UserPreference::BLUR_VIRTUAL_BACKGROUND) {
return $value === 'yes' || $value === 'no';
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Settings/UserPreference.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace OCA\Talk\Settings;

class UserPreference {
public const BLUR_BACKGROUND = 'blur_background';
public const BLUR_VIRTUAL_BACKGROUND = 'blur_virtual_background';
public const CALLS_START_WITHOUT_MEDIA = 'calls_start_without_media';
public const PLAY_SOUNDS = 'play_sounds';
public const TYPING_PRIVACY = 'typing_privacy';
Expand Down
4 changes: 2 additions & 2 deletions openapi-administration.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-background"
"blur-virtual-background"
],
"properties": {
"enabled": {
Expand Down Expand Up @@ -197,7 +197,7 @@
"type": "integer",
"format": "int64"
},
"blur-background": {
"blur-virtual-background": {
"type": "boolean"
}
}
Expand Down
4 changes: 2 additions & 2 deletions openapi-backend-recording.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-background"
"blur-virtual-background"
],
"properties": {
"enabled": {
Expand Down Expand Up @@ -130,7 +130,7 @@
"type": "integer",
"format": "int64"
},
"blur-background": {
"blur-virtual-background": {
"type": "boolean"
}
}
Expand Down
4 changes: 2 additions & 2 deletions openapi-backend-signaling.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-background"
"blur-virtual-background"
],
"properties": {
"enabled": {
Expand Down Expand Up @@ -130,7 +130,7 @@
"type": "integer",
"format": "int64"
},
"blur-background": {
"blur-virtual-background": {
"type": "boolean"
}
}
Expand Down
4 changes: 2 additions & 2 deletions openapi-backend-sipbridge.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-background"
"blur-virtual-background"
],
"properties": {
"enabled": {
Expand Down Expand Up @@ -173,7 +173,7 @@
"type": "integer",
"format": "int64"
},
"blur-background": {
"blur-virtual-background": {
"type": "boolean"
}
}
Expand Down
4 changes: 2 additions & 2 deletions openapi-bots.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-background"
"blur-virtual-background"
],
"properties": {
"enabled": {
Expand Down Expand Up @@ -130,7 +130,7 @@
"type": "integer",
"format": "int64"
},
"blur-background": {
"blur-virtual-background": {
"type": "boolean"
}
}
Expand Down
4 changes: 2 additions & 2 deletions openapi-federation.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-background"
"blur-virtual-background"
],
"properties": {
"enabled": {
Expand Down Expand Up @@ -173,7 +173,7 @@
"type": "integer",
"format": "int64"
},
"blur-background": {
"blur-virtual-background": {
"type": "boolean"
}
}
Expand Down
7 changes: 3 additions & 4 deletions openapi-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-background"
"blur-virtual-background"
],
"properties": {
"enabled": {
Expand Down Expand Up @@ -349,7 +349,7 @@
"type": "integer",
"format": "int64"
},
"blur-background": {
"blur-virtual-background": {
"type": "boolean"
}
}
Expand Down Expand Up @@ -16372,8 +16372,7 @@
"attachment_folder",
"read_status_privacy",
"typing_privacy",
"play_sounds",
"blur_background"
"play_sounds"
],
"description": "Key to update"
},
Expand Down
7 changes: 3 additions & 4 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
"can-enable-sip",
"start-without-media",
"max-duration",
"blur-background"
"blur-virtual-background"
],
"properties": {
"enabled": {
Expand Down Expand Up @@ -290,7 +290,7 @@
"type": "integer",
"format": "int64"
},
"blur-background": {
"blur-virtual-background": {
"type": "boolean"
}
}
Expand Down Expand Up @@ -16506,8 +16506,7 @@
"attachment_folder",
"read_status_privacy",
"typing_privacy",
"play_sounds",
"blur_background"
"play_sounds"
],
"description": "Key to update"
},
Expand Down
4 changes: 2 additions & 2 deletions src/__mocks__/capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const mockedCapabilities: Capabilities = {
'can-enable-sip': true,
'start-without-media': false,
'max-duration': 0,
'blur-background': false,
'blur-virtual-background': false,
},
chat: {
'max-length': 32000,
Expand Down Expand Up @@ -150,7 +150,7 @@ export const mockedCapabilities: Capabilities = {
'predefined-backgrounds',
'can-upload-background',
'start-without-media',
'blur-background',
'blur-virtual-background',
],
chat: [
'read-privacy',
Expand Down
2 changes: 1 addition & 1 deletion src/components/SettingsDialog/MediaDevicesPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ import { VIRTUAL_BACKGROUND } from '../../constants.js'
import { getTalkConfig } from '../../services/CapabilitiesManager.ts'
import { useSettingsStore } from '../../stores/settings.js'

const supportDefaultBlurBackground = getTalkConfig('local', 'call', 'blur-background') !== undefined
const supportDefaultBlurBackground = getTalkConfig('local', 'call', 'blur-virtual-background') !== undefined

export default {

Expand Down
2 changes: 1 addition & 1 deletion src/services/settingsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const setStartWithoutMedia = async function(value) {
}

const setBlurBackground = async function(value) {
await setUserConfig('spreed', 'blur_background', value ? 'yes' : 'no')
await setUserConfig('spreed', 'blur_virtual_background', value ? 'yes' : 'no')
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/stores/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const useSettingsStore = defineStore('settings', {
typingStatusPrivacy: loadState('spreed', 'typing_privacy', PRIVACY.PRIVATE),
showMediaSettings: {},
startWithoutMedia: getTalkConfig('local', 'call', 'start-without-media'),
blurBackgroundEnabled: getTalkConfig('local', 'call', 'blur-background'),
blurBackgroundEnabled: getTalkConfig('local', 'call', 'blur-virtual-background'),
}),

getters: {
Expand Down
2 changes: 1 addition & 1 deletion src/types/openapi/openapi-administration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export type components = {
"start-without-media": boolean;
/** Format: int64 */
"max-duration": number;
"blur-background": boolean;
"blur-virtual-background": boolean;
};
chat: {
/** Format: int64 */
Expand Down
2 changes: 1 addition & 1 deletion src/types/openapi/openapi-backend-recording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export type components = {
"start-without-media": boolean;
/** Format: int64 */
"max-duration": number;
"blur-background": boolean;
"blur-virtual-background": boolean;
};
chat: {
/** Format: int64 */
Expand Down
2 changes: 1 addition & 1 deletion src/types/openapi/openapi-backend-signaling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export type components = {
"start-without-media": boolean;
/** Format: int64 */
"max-duration": number;
"blur-background": boolean;
"blur-virtual-background": boolean;
};
chat: {
/** Format: int64 */
Expand Down
2 changes: 1 addition & 1 deletion src/types/openapi/openapi-backend-sipbridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export type components = {
"start-without-media": boolean;
/** Format: int64 */
"max-duration": number;
"blur-background": boolean;
"blur-virtual-background": boolean;
};
chat: {
/** Format: int64 */
Expand Down
2 changes: 1 addition & 1 deletion src/types/openapi/openapi-bots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export type components = {
"start-without-media": boolean;
/** Format: int64 */
"max-duration": number;
"blur-background": boolean;
"blur-virtual-background": boolean;
};
chat: {
/** Format: int64 */
Expand Down
2 changes: 1 addition & 1 deletion src/types/openapi/openapi-federation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export type components = {
"start-without-media": boolean;
/** Format: int64 */
"max-duration": number;
"blur-background": boolean;
"blur-virtual-background": boolean;
};
chat: {
/** Format: int64 */
Expand Down
4 changes: 2 additions & 2 deletions src/types/openapi/openapi-full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1927,7 +1927,7 @@ export type components = {
"start-without-media": boolean;
/** Format: int64 */
"max-duration": number;
"blur-background": boolean;
"blur-virtual-background": boolean;
};
chat: {
/** Format: int64 */
Expand Down Expand Up @@ -8278,7 +8278,7 @@ export interface operations {
* @description Key to update
* @enum {string}
*/
key: "attachment_folder" | "read_status_privacy" | "typing_privacy" | "play_sounds" | "blur_background";
key: "attachment_folder" | "read_status_privacy" | "typing_privacy" | "play_sounds";
/** @description New value for the key */
value?: (string | number) | null;
};
Expand Down
4 changes: 2 additions & 2 deletions src/types/openapi/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,7 @@ export type components = {
"start-without-media": boolean;
/** Format: int64 */
"max-duration": number;
"blur-background": boolean;
"blur-virtual-background": boolean;
};
chat: {
/** Format: int64 */
Expand Down Expand Up @@ -7859,7 +7859,7 @@ export interface operations {
* @description Key to update
* @enum {string}
*/
key: "attachment_folder" | "read_status_privacy" | "typing_privacy" | "play_sounds" | "blur_background";
key: "attachment_folder" | "read_status_privacy" | "typing_privacy" | "play_sounds";
/** @description New value for the key */
value?: (string | number) | null;
};
Expand Down
Loading

0 comments on commit b97a870

Please sign in to comment.