From 70634f8e40c131f5e1ae20717f865895cd542aaf Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 20 Nov 2025 17:52:15 +0100 Subject: [PATCH 1/2] fix(settings): Respect initial state for guests play sound Signed-off-by: Joas Schilling --- lib/TInitialState.php | 2 +- src/stores/sounds.js | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/TInitialState.php b/lib/TInitialState.php index ae250c14ff5..7459f1d7728 100644 --- a/lib/TInitialState.php +++ b/lib/TInitialState.php @@ -213,7 +213,7 @@ protected function publishInitialStateForGuest(): void { $this->initialState->provideInitialState( 'play_sounds', - false + true ); } } diff --git a/src/stores/sounds.js b/src/stores/sounds.js index 5c0d5866d99..d6aedbc6160 100644 --- a/src/stores/sounds.js +++ b/src/stores/sounds.js @@ -14,9 +14,16 @@ const hasUserAccount = Boolean(getCurrentUser()?.uid) /** * Get play sounds option (from server for user or from browser storage for guest) */ -const shouldPlaySounds = hasUserAccount - ? loadState('spreed', 'play_sounds', false) - : BrowserStorage.getItem('play_sounds') !== 'no' +let shouldPlaySounds = false +if (hasUserAccount) { + shouldPlaySounds = loadState('spreed', 'play_sounds', false) +} else { + if (BrowserStorage.getItem('play_sounds')) { + shouldPlaySounds = BrowserStorage.getItem('play_sounds') !== 'no' + } else { + shouldPlaySounds = loadState('spreed', 'play_sounds', false) + } +} /** * Preferred version is the .ogg, with .flac fallback if .ogg is not supported (Safari) From 3da72924816a953bd672c2de2a877d28002ecdda Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 20 Nov 2025 17:55:22 +0100 Subject: [PATCH 2/2] feat(settings): Add an app config to set the default for guests sound Signed-off-by: Joas Schilling --- docs/settings.md | 1 + lib/Config.php | 4 ++++ lib/TInitialState.php | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/settings.md b/docs/settings.md index 9a2589d6062..0f03c54d90c 100644 --- a/docs/settings.md +++ b/docs/settings.md @@ -134,6 +134,7 @@ Legend: | `backgrounds_branded_for_guests` | string
`1` or `0` | `0` | No | | Whether guests are allowed to use the virtual backgrounds provided via `themes/talk-backgrounds/` | | `backgrounds_default_for_users` | string
`1` or `0` | `1` | No | | Whether users are allowed to use the default virtual backgrounds provided by the releases | | `backgrounds_upload_users` | string
`1` or `0` | `1` | No | | Whether users are allowed to upload custom virtual backgrounds and choose from their Nextcloud Files | +| `guests_play_sounds` | string
`1` or `0` | `1` | No | | Whether guests hear the join and leave sounds by default | ## Experiments diff --git a/lib/Config.php b/lib/Config.php index 636416da4b9..3e9b4804f60 100644 --- a/lib/Config.php +++ b/lib/Config.php @@ -802,4 +802,8 @@ public function isCallEndToEndEncryptionEnabled(): bool { // TODO Default value will be set to true, once all mobile clients support it. return $this->appConfig->getAppValueBool('call_end_to_end_encryption'); } + + public function getPlaySoundsDefaultForGuests(): bool { + return $this->appConfig->getAppValueBool('guests_play_sounds', true); + } } diff --git a/lib/TInitialState.php b/lib/TInitialState.php index 7459f1d7728..23041b214f2 100644 --- a/lib/TInitialState.php +++ b/lib/TInitialState.php @@ -213,7 +213,7 @@ protected function publishInitialStateForGuest(): void { $this->initialState->provideInitialState( 'play_sounds', - true + $this->talkConfig->getPlaySoundsDefaultForGuests() ); } }