Bläddra i källkod

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 år sedan
förälder
incheckning
d22792c9e3
Inget konto är kopplat till bidragsgivarens mejladress
2 ändrade filer med 15 tillägg och 3 borttagningar
  1. 2
    3
      react/features/lobby/middleware.js
  2. 13
    0
      react/features/prejoin/functions.js

+ 2
- 3
react/features/lobby/middleware.js Visa fil

6
 import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';
6
 import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';
7
 import { isTestModeEnabled } from '../base/testing';
7
 import { isTestModeEnabled } from '../base/testing';
8
 import { NOTIFICATION_TYPE, showNotification } from '../notifications';
8
 import { NOTIFICATION_TYPE, showNotification } from '../notifications';
9
-import { isPrejoinPageEnabled } from '../prejoin/functions';
9
+import { shouldAutoKnock } from '../prejoin/functions';
10
 
10
 
11
 import { KNOCKING_PARTICIPANT_ARRIVED_OR_UPDATED } from './actionTypes';
11
 import { KNOCKING_PARTICIPANT_ARRIVED_OR_UPDATED } from './actionTypes';
12
 import {
12
 import {
100
 
100
 
101
         dispatch(openLobbyScreen());
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
             dispatch(startKnocking());
104
             dispatch(startKnocking());
106
         }
105
         }
107
 
106
 

+ 13
- 0
react/features/prejoin/functions.js Visa fil

162
 export function isPrejoinPageVisible(state: Object): boolean {
162
 export function isPrejoinPageVisible(state: Object): boolean {
163
     return isPrejoinPageEnabled(state) && state['features/prejoin']?.showPrejoin;
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
+}

Laddar…
Avbryt
Spara