feat(sip): Added auto-knocking for sip gateway if lobby is enabled
Co-authored-by: Gabriel Imre <gabriel.lucaci@8x8.com>
This commit is contained in:
parent
41e6af3464
commit
d22792c9e3
|
@ -6,7 +6,7 @@ import { getFirstLoadableAvatarUrl, getParticipantDisplayName } from '../base/pa
|
|||
import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';
|
||||
import { isTestModeEnabled } from '../base/testing';
|
||||
import { NOTIFICATION_TYPE, showNotification } from '../notifications';
|
||||
import { isPrejoinPageEnabled } from '../prejoin/functions';
|
||||
import { shouldAutoKnock } from '../prejoin/functions';
|
||||
|
||||
import { KNOCKING_PARTICIPANT_ARRIVED_OR_UPDATED } from './actionTypes';
|
||||
import {
|
||||
|
@ -100,8 +100,7 @@ function _conferenceFailed({ dispatch, getState }, next, action) {
|
|||
|
||||
dispatch(openLobbyScreen());
|
||||
|
||||
if (isPrejoinPageEnabled(state) && !state['features/lobby'].knocking) {
|
||||
// prejoin is enabled, so we knock automatically
|
||||
if (shouldAutoKnock(state)) {
|
||||
dispatch(startKnocking());
|
||||
}
|
||||
|
||||
|
|
|
@ -162,3 +162,16 @@ export function isPrejoinPageEnabled(state: Object): boolean {
|
|||
export function isPrejoinPageVisible(state: Object): boolean {
|
||||
return isPrejoinPageEnabled(state) && state['features/prejoin']?.showPrejoin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if we should auto-knock in case lobby is enabled for the room.
|
||||
*
|
||||
* @param {Object} state - The state of the app.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function shouldAutoKnock(state: Object): boolean {
|
||||
const { iAmRecorder, iAmSipGateway } = state['features/base/config'];
|
||||
|
||||
return (isPrejoinPageEnabled(state) || (iAmRecorder && iAmSipGateway))
|
||||
&& !state['features/lobby'].knocking;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue