feat(settings): add option to mute lobby knocking sounds

This commit is contained in:
nbeck.indy 2022-06-15 14:36:26 -04:00 committed by Saúl Ibarra Corretgé
parent 6f02382472
commit 6e32a146e3
6 changed files with 22 additions and 1 deletions

View File

@ -955,6 +955,7 @@
"name": "Name",
"noDevice": "None",
"participantJoined": "Participant Joined",
"participantKnocking": "Participant entered lobby",
"participantLeft": "Participant Left",
"playSounds": "Play sound on",
"reactions": "Meeting reactions",

View File

@ -30,6 +30,7 @@ const DEFAULT_STATE = {
hideShareAudioHelper: false,
soundsIncomingMessage: true,
soundsParticipantJoined: true,
soundsParticipantKnocking: true,
soundsParticipantLeft: true,
soundsTalkWhileMuted: true,
soundsReactions: true,

View File

@ -96,6 +96,8 @@ StateListenerRegistry.register(
});
conference.on(JitsiConferenceEvents.LOBBY_USER_JOINED, (id, name) => {
const { soundsParticipantKnocking } = getState()['features/base/settings'];
batch(() => {
dispatch(
participantIsKnockingOrUpdated({
@ -103,7 +105,9 @@ StateListenerRegistry.register(
name
})
);
if (soundsParticipantKnocking) {
dispatch(playSound(KNOCKING_PARTICIPANT_SOUND_ID));
}
const isParticipantsPaneVisible = getParticipantsPaneOpen(getState());

View File

@ -191,6 +191,7 @@ export function submitSoundsTab(newState: Object): Function {
const shouldNotUpdateReactionSounds = getModeratorTabProps(getState()).startReactionsMuted;
const shouldUpdate = (newState.soundsIncomingMessage !== currentState.soundsIncomingMessage)
|| (newState.soundsParticipantJoined !== currentState.soundsParticipantJoined)
|| (newState.soundsParticipantKnocking !== currentState.soundsParticipantKnocking)
|| (newState.soundsParticipantLeft !== currentState.soundsParticipantLeft)
|| (newState.soundsTalkWhileMuted !== currentState.soundsTalkWhileMuted)
|| (newState.soundsReactions !== currentState.soundsReactions);
@ -199,6 +200,7 @@ export function submitSoundsTab(newState: Object): Function {
const settingsToUpdate = {
soundsIncomingMessage: newState.soundsIncomingMessage,
soundsParticipantJoined: newState.soundsParticipantJoined,
soundsParticipantKnocking: newState.soundsParticipantKnocking,
soundsParticipantLeft: newState.soundsParticipantLeft,
soundsTalkWhileMuted: newState.soundsTalkWhileMuted,
soundsReactions: newState.soundsReactions

View File

@ -30,6 +30,11 @@ export type Props = {
*/
soundsParticipantJoined: Boolean,
/**
* Whether or not the sound for the participant entering the lobby should play.
*/
soundsParticipantKnocking: Boolean,
/**
* Whether or not the sound for the participant left should play.
*/
@ -98,6 +103,7 @@ class SoundsTab extends AbstractDialogTab<Props> {
const {
soundsIncomingMessage,
soundsParticipantJoined,
soundsParticipantKnocking,
soundsParticipantLeft,
soundsTalkWhileMuted,
soundsReactions,
@ -140,6 +146,11 @@ class SoundsTab extends AbstractDialogTab<Props> {
label = { t('settings.talkWhileMuted') }
name = 'soundsTalkWhileMuted'
onChange = { this._onChange } />
<Checkbox
isChecked = { soundsParticipantKnocking }
label = { t('settings.participantKnocking') }
name = 'soundsParticipantKnocking'
onChange = { this._onChange } />
</div>
);
}

View File

@ -230,6 +230,7 @@ export function getSoundsTabProps(stateful: Object | Function) {
const {
soundsIncomingMessage,
soundsParticipantJoined,
soundsParticipantKnocking,
soundsParticipantLeft,
soundsTalkWhileMuted,
soundsReactions
@ -240,6 +241,7 @@ export function getSoundsTabProps(stateful: Object | Function) {
return {
soundsIncomingMessage,
soundsParticipantJoined,
soundsParticipantKnocking,
soundsParticipantLeft,
soundsTalkWhileMuted,
soundsReactions,