Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ Legend:
| `backgrounds_branded_for_guests` | string<br>`1` or `0` | `0` | No | | Whether guests are allowed to use the virtual backgrounds provided via `themes/talk-backgrounds/` |
| `backgrounds_default_for_users` | string<br>`1` or `0` | `1` | No | | Whether users are allowed to use the default virtual backgrounds provided by the releases |
| `backgrounds_upload_users` | string<br>`1` or `0` | `1` | No | | Whether users are allowed to upload custom virtual backgrounds and choose from their Nextcloud Files |
| `guests_play_sounds` | string<br>`1` or `0` | `1` | No | | Whether guests hear the join and leave sounds by default |

## Experiments

Expand Down
4 changes: 4 additions & 0 deletions lib/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -791,4 +791,8 @@ public function isChatRelayEnabled(): bool {
& self::EXPERIMENT_CHAT_RELAY;
return $isEnabled === self::EXPERIMENT_CHAT_RELAY;
}

public function getPlaySoundsDefaultForGuests(): bool {
return $this->appConfig->getAppValueBool('guests_play_sounds', true);
}
}
2 changes: 1 addition & 1 deletion lib/TInitialState.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ protected function publishInitialStateForGuest(): void {

$this->initialState->provideInitialState(
'play_sounds',
false
$this->talkConfig->getPlaySoundsDefaultForGuests()
);
}
}
13 changes: 10 additions & 3 deletions src/stores/sounds.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading