diff --git a/src/components/MediaSettings/MediaSettings.vue b/src/components/MediaSettings/MediaSettings.vue index 41fdeca16b9..e1c27398f48 100644 --- a/src/components/MediaSettings/MediaSettings.vue +++ b/src/components/MediaSettings/MediaSettings.vue @@ -642,7 +642,12 @@ export default { this.audioOn = !BrowserStorage.getItem('audioDisabled_' + this.token) this.videoOn = !BrowserStorage.getItem('videoDisabled_' + this.token) } - this.notifyCall = BrowserStorage.getItem('silentCall_' + this.token) !== 'true' + //check if this call has a silent call flag in storage, otherwise use the default setting from the settings store + const hasSilentCallFlag = BrowserStorage.getItem('silentCall_' + this.token) + console.log('hasSilentCallFlag', hasSilentCallFlag, 'defaultCallMethodIsSilent', this.settingsStore.defaultCallMethodIsSilent) + this.notifyCall = hasSilentCallFlag !== null + ? hasSilentCallFlag !== 'true' + : !this.settingsStore.defaultCallMethodIsSilent // Set virtual background depending on BrowserStorage's settings if (BrowserStorage.getItem('virtualBackgroundEnabled') === 'true') { diff --git a/src/components/SettingsDialog/SettingsDialog.vue b/src/components/SettingsDialog/SettingsDialog.vue index a21defe4da7..ca523d9aed0 100644 --- a/src/components/SettingsDialog/SettingsDialog.vue +++ b/src/components/SettingsDialog/SettingsDialog.vue @@ -39,6 +39,11 @@ :label="t('spreed', 'Skip device preview before joining a call')" :description="t('spreed', 'Camera will be turned off when joining. Always shown if recording consent is required.')" @update:modelValue="setHideMediaSettings" /> + @@ -249,6 +254,9 @@ export default { hideMediaSettings() { return !this.settingsStore.showMediaSettings }, + defaultCallMethodIsSilent() { + return this.settingsStore.defaultCallMethodIsSilent + }, }, mounted() { @@ -338,6 +346,10 @@ export default { this.settingsStore.setShowMediaSettings(!newValue) }, + setDefaultCallMethodIsSilent(newValue) { + this.settingsStore.setDefaultCallMethodIsSilent(newValue) + }, + async openAdvancedSettings() { await spawnDialog(AdvancedAudioDialog, { container: '#devices', diff --git a/src/components/TopBar/CallButton.vue b/src/components/TopBar/CallButton.vue index 76524844082..c83c152013e 100644 --- a/src/components/TopBar/CallButton.vue +++ b/src/components/TopBar/CallButton.vue @@ -171,7 +171,7 @@ export default { */ silentCall: { type: Boolean, - default: false, + default: null, }, isRecordingFromStart: { @@ -385,7 +385,7 @@ export default { async handleJoinCall() { this.loading = true await this.joinCall(this.token, { - silent: this.hasCall ? true : this.silentCall, + silent: this.hasCall ? true : this.silentCall !== null ? this.silentCall : false, recordingConsent: this.recordingConsentGiven, shouldStartRecording: this.isRecordingFromStart, }) diff --git a/src/components/TopBar/TopBar.vue b/src/components/TopBar/TopBar.vue index a6f8540728a..59938b73ca5 100644 --- a/src/components/TopBar/TopBar.vue +++ b/src/components/TopBar/TopBar.vue @@ -127,7 +127,7 @@ - + { const readStatusPrivacy = ref(getTalkConfig('local', 'chat', 'read-privacy') as TALK_CONFIG_PRIVACY ?? PRIVACY.PRIVATE) const typingStatusPrivacy = ref(getTalkConfig('local', 'chat', 'typing-privacy') as TALK_CONFIG_PRIVACY ?? PRIVACY.PRIVATE) const showMediaSettings = ref(BrowserStorage.getItem('showMediaSettings') !== 'false') + const defaultCallMethodIsSilent = ref(BrowserStorage.getItem('defaultCallMethodIsSilent') === 'true') const noiseSuppression = ref(BrowserStorage.getItem('noiseSuppression') !== 'false' && !isSafari) const noiseSuppressionWithModel = ref<'none' | 'rnnoise' | (string & {})>(BrowserStorage.getItem('noiseSuppressionWithModel') ?? 'none') const echoCancellation = ref(BrowserStorage.getItem('echoCancellation') !== 'false') @@ -111,6 +112,16 @@ export const useSettingsStore = defineStore('settings', () => { showMediaSettings.value = value } + /** + * Update the default for silent call + * + * @param value - new selected state + */ + function setDefaultCallMethodIsSilent(value: boolean) { + BrowserStorage.setItem('defaultCallMethodIsSilent', value.toString()) + defaultCallMethodIsSilent.value = value + } + /** * Update the noise suppression settings for the user * @@ -254,6 +265,7 @@ export const useSettingsStore = defineStore('settings', () => { readStatusPrivacy, typingStatusPrivacy, showMediaSettings, + defaultCallMethodIsSilent, noiseSuppression, noiseSuppressionWithModel, echoCancellation, @@ -276,6 +288,7 @@ export const useSettingsStore = defineStore('settings', () => { updateReadStatusPrivacy, updateTypingStatusPrivacy, setShowMediaSettings, + setDefaultCallMethodIsSilent, setNoiseSuppression, setNoiseSuppressionWithModel, setEchoCancellation,