浏览代码

ref: move 'jwt' feature to 'base'

j8
paweldomas 8 年前
父节点
当前提交
122be9e0e0

+ 1
- 1
conference.js 查看文件

217
 function maybeRedirectToWelcomePage(options) {
217
 function maybeRedirectToWelcomePage(options) {
218
     // if close page is enabled redirect to it, without further action
218
     // if close page is enabled redirect to it, without further action
219
     if (config.enableClosePage) {
219
     if (config.enableClosePage) {
220
-        const { isGuest } = APP.store.getState()['features/jwt'];
220
+        const { isGuest } = APP.store.getState()['features/base/jwt'];
221
 
221
 
222
         // save whether current user is guest or not, before navigating
222
         // save whether current user is guest or not, before navigating
223
         // to close page
223
         // to close page

+ 2
- 2
connection.js 查看文件

62
  */
62
  */
63
 function connect(id, password, roomName) {
63
 function connect(id, password, roomName) {
64
     const connectionConfig = Object.assign({}, config);
64
     const connectionConfig = Object.assign({}, config);
65
-    const { issuer, jwt } = APP.store.getState()['features/jwt'];
65
+    const { issuer, jwt } = APP.store.getState()['features/base/jwt'];
66
 
66
 
67
     connectionConfig.bosh += '?room=' + roomName;
67
     connectionConfig.bosh += '?room=' + roomName;
68
 
68
 
147
 
147
 
148
     return connect(id, password, roomName).catch(err => {
148
     return connect(id, password, roomName).catch(err => {
149
         if (retry) {
149
         if (retry) {
150
-            const { issuer, jwt } = APP.store.getState()['features/jwt'];
150
+            const { issuer, jwt } = APP.store.getState()['features/base/jwt'];
151
 
151
 
152
             if (err === ConnectionErrors.PASSWORD_REQUIRED
152
             if (err === ConnectionErrors.PASSWORD_REQUIRED
153
                     && (!jwt || issuer === 'anonymous')) {
153
                     && (!jwt || issuer === 'anonymous')) {

+ 1
- 1
modules/API/API.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
 import * as JitsiMeetConferenceEvents from '../../ConferenceEvents';
3
 import * as JitsiMeetConferenceEvents from '../../ConferenceEvents';
4
-import { parseJWTFromURLParams } from '../../react/features/jwt';
4
+import { parseJWTFromURLParams } from '../../react/features/base/jwt';
5
 import { getJitsiMeetTransport } from '../transport';
5
 import { getJitsiMeetTransport } from '../transport';
6
 
6
 
7
 import { API_ID } from './constants';
7
 import { API_ID } from './constants';

+ 1
- 1
modules/UI/authentication/AuthHandler.js 查看文件

1
 /* global APP, config, JitsiMeetJS, Promise */
1
 /* global APP, config, JitsiMeetJS, Promise */
2
 
2
 
3
 import { openConnection } from '../../../connection';
3
 import { openConnection } from '../../../connection';
4
-import { setJWT } from '../../../react/features/jwt';
4
+import { setJWT } from '../../../react/features/base/jwt';
5
 import UIUtil from '../util/UIUtil';
5
 import UIUtil from '../util/UIUtil';
6
 
6
 
7
 import LoginDialog from './LoginDialog';
7
 import LoginDialog from './LoginDialog';

+ 1
- 1
react/features/analytics/functions.js 查看文件

43
                 roomName: state['features/base/conference'].room,
43
                 roomName: state['features/base/conference'].room,
44
                 userAgent: navigator.userAgent
44
                 userAgent: navigator.userAgent
45
             };
45
             };
46
-            const { group, server } = state['features/jwt'];
46
+            const { group, server } = state['features/base/jwt'];
47
 
47
 
48
             if (server) {
48
             if (server) {
49
                 permanentProperties.server = server;
49
                 permanentProperties.server = server;

+ 1
- 1
react/features/base/connection/actions.native.js 查看文件

26
     return (dispatch: Dispatch<*>, getState: Function) => {
26
     return (dispatch: Dispatch<*>, getState: Function) => {
27
         const state = getState();
27
         const state = getState();
28
         const options = _constructOptions(state);
28
         const options = _constructOptions(state);
29
-        const { issuer, jwt } = state['features/jwt'];
29
+        const { issuer, jwt } = state['features/base/jwt'];
30
         const connection
30
         const connection
31
             = new JitsiMeetJS.JitsiConnection(
31
             = new JitsiMeetJS.JitsiConnection(
32
                 options.appId,
32
                 options.appId,

react/features/jwt/actionTypes.js → react/features/base/jwt/actionTypes.js 查看文件


react/features/jwt/actions.js → react/features/base/jwt/actions.js 查看文件

15
  */
15
  */
16
 export function setCallOverlayVisible(callOverlayVisible: boolean) {
16
 export function setCallOverlayVisible(callOverlayVisible: boolean) {
17
     return (dispatch: Dispatch<*>, getState: Function) => {
17
     return (dispatch: Dispatch<*>, getState: Function) => {
18
-        getState()['features/jwt'].callOverlayVisible === callOverlayVisible
18
+        getState()['features/base/jwt']
19
+            .callOverlayVisible === callOverlayVisible
19
             || dispatch({
20
             || dispatch({
20
                 type: SET_CALL_OVERLAY_VISIBLE,
21
                 type: SET_CALL_OVERLAY_VISIBLE,
21
                 callOverlayVisible
22
                 callOverlayVisible

react/features/jwt/components/CallOverlay.js → react/features/base/jwt/components/CallOverlay.js 查看文件

4
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
5
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
6
 
6
 
7
-import { Audio } from '../../base/media';
8
-import { Avatar } from '../../base/participants';
9
-import { Container, Text } from '../../base/react';
10
-import UIEvents from '../../../../service/UI/UIEvents';
7
+import { Audio } from '../../media';
8
+import { Avatar } from '../../participants';
9
+import { Container, Text } from '../../react';
10
+import UIEvents from '../../../../../service/UI/UIEvents';
11
 
11
 
12
 import styles from './styles';
12
 import styles from './styles';
13
 
13
 
335
          * @private
335
          * @private
336
          * @type {Object}
336
          * @type {Object}
337
          */
337
          */
338
-        _callee: state['features/jwt'].callee
338
+        _callee: state['features/base/jwt'].callee
339
     };
339
     };
340
 }
340
 }
341
 
341
 

react/features/jwt/components/index.js → react/features/base/jwt/components/index.js 查看文件


react/features/jwt/components/styles.native.js → react/features/base/jwt/components/styles.native.js 查看文件

1
-import { ColorPalette, createStyleSheet } from '../../base/styles';
1
+import { ColorPalette, createStyleSheet } from '../../styles';
2
 
2
 
3
 export default createStyleSheet({
3
 export default createStyleSheet({
4
     // XXX The names bellow were preserved for the purposes of compatibility
4
     // XXX The names bellow were preserved for the purposes of compatibility

react/features/jwt/components/styles.web.js → react/features/base/jwt/components/styles.web.js 查看文件


react/features/jwt/functions.js → react/features/base/jwt/functions.js 查看文件

1
 /* @flow */
1
 /* @flow */
2
 
2
 
3
-import { parseURLParams } from '../base/config';
3
+import { parseURLParams } from '../config';
4
 
4
 
5
 /**
5
 /**
6
  * Retrieves the JSON Web Token (JWT), if any, defined by a specific
6
  * Retrieves the JSON Web Token (JWT), if any, defined by a specific

react/features/jwt/index.js → react/features/base/jwt/index.js 查看文件


react/features/jwt/middleware.js → react/features/base/jwt/middleware.js 查看文件

5
     CONFERENCE_LEFT,
5
     CONFERENCE_LEFT,
6
     CONFERENCE_WILL_LEAVE,
6
     CONFERENCE_WILL_LEAVE,
7
     SET_ROOM
7
     SET_ROOM
8
-} from '../base/conference';
9
-import { SET_CONFIG } from '../base/config';
10
-import { SET_LOCATION_URL } from '../base/connection';
11
-import { LIB_INIT_ERROR } from '../base/lib-jitsi-meet';
8
+} from '../conference';
9
+import { SET_CONFIG } from '../config';
10
+import { SET_LOCATION_URL } from '../connection';
11
+import { LIB_INIT_ERROR } from '../lib-jitsi-meet';
12
 import {
12
 import {
13
     getLocalParticipant,
13
     getLocalParticipant,
14
     getParticipantCount,
14
     getParticipantCount,
15
     PARTICIPANT_JOINED
15
     PARTICIPANT_JOINED
16
-} from '../base/participants';
17
-import { MiddlewareRegistry } from '../base/redux';
16
+} from '../participants';
17
+import { MiddlewareRegistry } from '../redux';
18
 
18
 
19
 import { setCallOverlayVisible, setJWT } from './actions';
19
 import { setCallOverlayVisible, setJWT } from './actions';
20
 import { SET_JWT } from './actionTypes';
20
 import { SET_JWT } from './actionTypes';
72
     const result = next(action);
72
     const result = next(action);
73
 
73
 
74
     const state = getState();
74
     const state = getState();
75
-    const stateFeaturesJWT = state['features/jwt'];
75
+    const stateFeaturesJWT = state['features/base/jwt'];
76
     let callOverlayVisible;
76
     let callOverlayVisible;
77
 
77
 
78
     if (stateFeaturesJWT.callee) {
78
     if (stateFeaturesJWT.callee) {

react/features/jwt/reducer.js → react/features/base/jwt/reducer.js 查看文件

1
-import { equals, set, ReducerRegistry } from '../base/redux';
1
+import { equals, set, ReducerRegistry } from '../redux';
2
 
2
 
3
 import { SET_CALL_OVERLAY_VISIBLE, SET_JWT } from './actionTypes';
3
 import { SET_CALL_OVERLAY_VISIBLE, SET_JWT } from './actionTypes';
4
 
4
 
37
  * @returns {Object} The next redux state which is the result of reducing the
37
  * @returns {Object} The next redux state which is the result of reducing the
38
  * specified {@code action}.
38
  * specified {@code action}.
39
  */
39
  */
40
-ReducerRegistry.register('features/jwt', (state = _INITIAL_STATE, action) => {
40
+ReducerRegistry.register(
41
+'features/base/jwt', (state = _INITIAL_STATE, action) => {
41
     switch (action.type) {
42
     switch (action.type) {
42
     case SET_CALL_OVERLAY_VISIBLE:
43
     case SET_CALL_OVERLAY_VISIBLE:
43
         return set(state, 'callOverlayVisible', action.callOverlayVisible);
44
         return set(state, 'callOverlayVisible', action.callOverlayVisible);

+ 1
- 1
react/features/base/react/components/web/Watermarks.js 查看文件

190
  * }}
190
  * }}
191
  */
191
  */
192
 function _mapStateToProps(state) {
192
 function _mapStateToProps(state) {
193
-    const { isGuest } = state['features/jwt'];
193
+    const { isGuest } = state['features/base/jwt'];
194
 
194
 
195
     return {
195
     return {
196
         /**
196
         /**

+ 1
- 1
react/features/conference/route.js 查看文件

111
  */
111
  */
112
 function _setTokenData() {
112
 function _setTokenData() {
113
     const state = APP.store.getState();
113
     const state = APP.store.getState();
114
-    const { caller } = state['features/jwt'];
114
+    const { caller } = state['features/base/jwt'];
115
 
115
 
116
     if (caller) {
116
     if (caller) {
117
         const { avatarUrl, avatar, email, name } = caller;
117
         const { avatarUrl, avatar, email, name } = caller;

+ 3
- 3
react/features/filmstrip/middleware.js 查看文件

1
 /* @flow */
1
 /* @flow */
2
 
2
 
3
 import { MiddlewareRegistry } from '../base/redux';
3
 import { MiddlewareRegistry } from '../base/redux';
4
-import { SET_CALL_OVERLAY_VISIBLE } from '../jwt';
4
+import { SET_CALL_OVERLAY_VISIBLE } from '../base/jwt';
5
 
5
 
6
 import Filmstrip from '../../../modules/UI/videolayout/Filmstrip';
6
 import Filmstrip from '../../../modules/UI/videolayout/Filmstrip';
7
 
7
 
13
     case SET_CALL_OVERLAY_VISIBLE:
13
     case SET_CALL_OVERLAY_VISIBLE:
14
         if (typeof APP !== 'undefined') {
14
         if (typeof APP !== 'undefined') {
15
             const oldValue
15
             const oldValue
16
-                = Boolean(getState()['features/jwt'].callOverlayVisible);
16
+                = Boolean(getState()['features/base/jwt'].callOverlayVisible);
17
             const result = next(action);
17
             const result = next(action);
18
             const newValue
18
             const newValue
19
-                = Boolean(getState()['features/jwt'].callOverlayVisible);
19
+                = Boolean(getState()['features/base/jwt'].callOverlayVisible);
20
 
20
 
21
             oldValue === newValue
21
             oldValue === newValue
22
 
22
 

+ 1
- 1
react/features/invite/components/AddPeopleDialog.web.js 查看文件

349
         _conference: conference,
349
         _conference: conference,
350
         _inviteServiceUrl: inviteServiceUrl,
350
         _inviteServiceUrl: inviteServiceUrl,
351
         _inviteUrl: getInviteURL(state),
351
         _inviteUrl: getInviteURL(state),
352
-        _jwt: state['features/jwt'].jwt,
352
+        _jwt: state['features/base/jwt'].jwt,
353
         _peopleSearchQueryTypes: peopleSearchQueryTypes,
353
         _peopleSearchQueryTypes: peopleSearchQueryTypes,
354
         _peopleSearchUrl: peopleSearchUrl
354
         _peopleSearchUrl: peopleSearchUrl
355
     };
355
     };

+ 1
- 1
react/features/invite/components/InfoDialog.web.js 查看文件

192
 function _mapStateToProps(state) {
192
 function _mapStateToProps(state) {
193
     return {
193
     return {
194
         _inviteURL: getInviteURL(state),
194
         _inviteURL: getInviteURL(state),
195
-        _showAddPeople: !state['features/jwt'].isGuest
195
+        _showAddPeople: !state['features/base/jwt'].isGuest
196
     };
196
     };
197
 }
197
 }
198
 
198
 

+ 1
- 1
react/features/invite/components/InviteButton.web.js 查看文件

219
 function _mapStateToProps(state) {
219
 function _mapStateToProps(state) {
220
     const { conference } = state['features/base/conference'];
220
     const { conference } = state['features/base/conference'];
221
     const { enableUserRolesBasedOnToken } = state['features/base/config'];
221
     const { enableUserRolesBasedOnToken } = state['features/base/config'];
222
-    const { isGuest } = state['features/jwt'];
222
+    const { isGuest } = state['features/base/jwt'];
223
 
223
 
224
     return {
224
     return {
225
         _isAddToCallAvailable:
225
         _isAddToCallAvailable:

+ 1
- 1
react/features/mobile/callkit/middleware.js 查看文件

220
     CallKit.startCall(conference.callUUID, url.toString(), hasVideo)
220
     CallKit.startCall(conference.callUUID, url.toString(), hasVideo)
221
         .then(() => {
221
         .then(() => {
222
             const { room } = state['features/base/conference'];
222
             const { room } = state['features/base/conference'];
223
-            const { callee } = state['features/jwt'];
223
+            const { callee } = state['features/base/jwt'];
224
 
224
 
225
             CallKit.updateCall(
225
             CallKit.updateCall(
226
                 conference.callUUID,
226
                 conference.callUUID,

+ 1
- 1
react/features/notifications/components/NotificationsContainer.web.js 查看文件

185
     const isAnyOverlayVisible = (connectionEstablished && haveToReload)
185
     const isAnyOverlayVisible = (connectionEstablished && haveToReload)
186
         || isMediaPermissionPromptVisible
186
         || isMediaPermissionPromptVisible
187
         || suspendDetected
187
         || suspendDetected
188
-        || state['features/jwt'].callOverlayVisible;
188
+        || state['features/base/jwt'].callOverlayVisible;
189
 
189
 
190
     const { enabled, notifications } = state['features/notifications'];
190
     const { enabled, notifications } = state['features/notifications'];
191
 
191
 

+ 3
- 2
react/features/overlay/components/OverlayContainer.js 查看文件

2
 import React, { Component } from 'react';
2
 import React, { Component } from 'react';
3
 import { connect } from 'react-redux';
3
 import { connect } from 'react-redux';
4
 
4
 
5
-import { CallOverlay } from '../../jwt';
5
+import { CallOverlay } from '../../base/jwt';
6
 
6
 
7
 import PageReloadFilmstripOnlyOverlay from './PageReloadFilmstripOnlyOverlay';
7
 import PageReloadFilmstripOnlyOverlay from './PageReloadFilmstripOnlyOverlay';
8
 import PageReloadOverlay from './PageReloadOverlay';
8
 import PageReloadOverlay from './PageReloadOverlay';
214
          * @private
214
          * @private
215
          * @type {boolean}
215
          * @type {boolean}
216
          */
216
          */
217
-        _callOverlayVisible: Boolean(state['features/jwt'].callOverlayVisible),
217
+        _callOverlayVisible:
218
+            Boolean(state['features/base/jwt'].callOverlayVisible),
218
 
219
 
219
         /**
220
         /**
220
          * The indicator which determines whether the status of the
221
          * The indicator which determines whether the status of the

+ 1
- 1
react/features/toolbox/actions.web.js 查看文件

187
 
187
 
188
         if (!force
188
         if (!force
189
                 && (hovered
189
                 && (hovered
190
-                    || state['features/jwt'].callOverlayVisible
190
+                    || state['features/base/jwt'].callOverlayVisible
191
                     || SideContainerToggler.isVisible())) {
191
                     || SideContainerToggler.isVisible())) {
192
             dispatch(
192
             dispatch(
193
                 setToolboxTimeout(
193
                 setToolboxTimeout(

+ 1
- 1
react/features/toolbox/components/ProfileButton.web.js 查看文件

120
  */
120
  */
121
 function _mapStateToProps(state) {
121
 function _mapStateToProps(state) {
122
     return {
122
     return {
123
-        _unclickable: !state['features/jwt'].isGuest
123
+        _unclickable: !state['features/base/jwt'].isGuest
124
     };
124
     };
125
 }
125
 }
126
 
126
 

+ 1
- 1
react/features/toolbox/components/SecondaryToolbar.web.js 查看文件

147
  * @private
147
  * @private
148
  */
148
  */
149
 function _mapStateToProps(state: Object): Object {
149
 function _mapStateToProps(state: Object): Object {
150
-    const { isGuest } = state['features/jwt'];
150
+    const { isGuest } = state['features/base/jwt'];
151
     const { secondaryToolbarButtons, visible } = state['features/toolbox'];
151
     const { secondaryToolbarButtons, visible } = state['features/toolbox'];
152
     const { callStatsID } = state['features/base/config'];
152
     const { callStatsID } = state['features/base/config'];
153
 
153
 

正在加载...
取消
保存