Ver código fonte

feat(sip): Added auto-knocking for sip gateway if lobby is enabled

Co-authored-by: Gabriel Imre <gabriel.lucaci@8x8.com>
j8
Gabriel Imre 4 anos atrás
pai
commit
d22792c9e3
Nenhuma conta vinculada ao e-mail do autor do commit

+ 2
- 3
react/features/lobby/middleware.js Ver arquivo

@@ -6,7 +6,7 @@ import { getFirstLoadableAvatarUrl, getParticipantDisplayName } from '../base/pa
6 6
 import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';
7 7
 import { isTestModeEnabled } from '../base/testing';
8 8
 import { NOTIFICATION_TYPE, showNotification } from '../notifications';
9
-import { isPrejoinPageEnabled } from '../prejoin/functions';
9
+import { shouldAutoKnock } from '../prejoin/functions';
10 10
 
11 11
 import { KNOCKING_PARTICIPANT_ARRIVED_OR_UPDATED } from './actionTypes';
12 12
 import {
@@ -100,8 +100,7 @@ function _conferenceFailed({ dispatch, getState }, next, action) {
100 100
 
101 101
         dispatch(openLobbyScreen());
102 102
 
103
-        if (isPrejoinPageEnabled(state) && !state['features/lobby'].knocking) {
104
-            // prejoin is enabled, so we knock automatically
103
+        if (shouldAutoKnock(state)) {
105 104
             dispatch(startKnocking());
106 105
         }
107 106
 

+ 13
- 0
react/features/prejoin/functions.js Ver arquivo

@@ -162,3 +162,16 @@ export function isPrejoinPageEnabled(state: Object): boolean {
162 162
 export function isPrejoinPageVisible(state: Object): boolean {
163 163
     return isPrejoinPageEnabled(state) && state['features/prejoin']?.showPrejoin;
164 164
 }
165
+
166
+/**
167
+ * Returns true if we should auto-knock in case lobby is enabled for the room.
168
+ *
169
+ * @param {Object} state - The state of the app.
170
+ * @returns {boolean}
171
+ */
172
+export function shouldAutoKnock(state: Object): boolean {
173
+    const { iAmRecorder, iAmSipGateway } = state['features/base/config'];
174
+
175
+    return (isPrejoinPageEnabled(state) || (iAmRecorder && iAmSipGateway))
176
+        && !state['features/lobby'].knocking;
177
+}

Carregando…
Cancelar
Salvar