2020-04-15 13:13:43 +00:00
|
|
|
// @flow
|
|
|
|
|
2020-05-20 08:25:31 +00:00
|
|
|
import { getCurrentConference } from '../base/conference';
|
2020-04-15 13:13:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Approves (lets in) or rejects a knocking participant.
|
|
|
|
*
|
|
|
|
* @param {Function} getState - Function to get the Redux state.
|
|
|
|
* @param {string} id - The id of the knocking participant.
|
|
|
|
* @param {boolean} approved - True if the participant is approved, false otherwise.
|
|
|
|
* @returns {Function}
|
|
|
|
*/
|
|
|
|
export function setKnockingParticipantApproval(getState: Function, id: string, approved: boolean) {
|
2020-05-20 08:25:31 +00:00
|
|
|
const conference = getCurrentConference(getState());
|
2020-04-15 13:13:43 +00:00
|
|
|
|
|
|
|
if (conference) {
|
|
|
|
if (approved) {
|
|
|
|
conference.lobbyApproveAccess(id);
|
|
|
|
} else {
|
|
|
|
conference.lobbyDenyAccess(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-04-21 13:48:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Selector to return lobby state.
|
|
|
|
*
|
|
|
|
* @param {any} state - State object.
|
|
|
|
* @returns {any}
|
|
|
|
*/
|
|
|
|
export function getLobbyState(state: any) {
|
|
|
|
return state['features/lobby'];
|
|
|
|
}
|