Skip to content

Commit

Permalink
ref: move 'jwt' feature to 'base'
Browse files Browse the repository at this point in the history
  • Loading branch information
paweldomas authored and lyubomir committed Oct 12, 2017
1 parent 887e1b6 commit 122be9e
Show file tree
Hide file tree
Showing 28 changed files with 42 additions and 39 deletions.
2 changes: 1 addition & 1 deletion conference.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function muteLocalVideo(muted) {
function maybeRedirectToWelcomePage(options) {
// if close page is enabled redirect to it, without further action
if (config.enableClosePage) {
const { isGuest } = APP.store.getState()['features/jwt'];
const { isGuest } = APP.store.getState()['features/base/jwt'];

// save whether current user is guest or not, before navigating
// to close page
Expand Down
4 changes: 2 additions & 2 deletions connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function checkForAttachParametersAndConnect(id, password, connection) {
*/
function connect(id, password, roomName) {
const connectionConfig = Object.assign({}, config);
const { issuer, jwt } = APP.store.getState()['features/jwt'];
const { issuer, jwt } = APP.store.getState()['features/base/jwt'];

connectionConfig.bosh += '?room=' + roomName;

Expand Down Expand Up @@ -147,7 +147,7 @@ export function openConnection({id, password, retry, roomName}) {

return connect(id, password, roomName).catch(err => {
if (retry) {
const { issuer, jwt } = APP.store.getState()['features/jwt'];
const { issuer, jwt } = APP.store.getState()['features/base/jwt'];

if (err === ConnectionErrors.PASSWORD_REQUIRED
&& (!jwt || issuer === 'anonymous')) {
Expand Down
2 changes: 1 addition & 1 deletion modules/API/API.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow

import * as JitsiMeetConferenceEvents from '../../ConferenceEvents';
import { parseJWTFromURLParams } from '../../react/features/jwt';
import { parseJWTFromURLParams } from '../../react/features/base/jwt';
import { getJitsiMeetTransport } from '../transport';

import { API_ID } from './constants';
Expand Down
2 changes: 1 addition & 1 deletion modules/UI/authentication/AuthHandler.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* global APP, config, JitsiMeetJS, Promise */

import { openConnection } from '../../../connection';
import { setJWT } from '../../../react/features/jwt';
import { setJWT } from '../../../react/features/base/jwt';
import UIUtil from '../util/UIUtil';

import LoginDialog from './LoginDialog';
Expand Down
2 changes: 1 addition & 1 deletion react/features/analytics/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function initAnalytics({ getState }: { getState: Function }) {
roomName: state['features/base/conference'].room,
userAgent: navigator.userAgent
};
const { group, server } = state['features/jwt'];
const { group, server } = state['features/base/jwt'];

if (server) {
permanentProperties.server = server;
Expand Down
2 changes: 1 addition & 1 deletion react/features/base/connection/actions.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function connect(id: ?string, password: ?string) {
return (dispatch: Dispatch<*>, getState: Function) => {
const state = getState();
const options = _constructOptions(state);
const { issuer, jwt } = state['features/jwt'];
const { issuer, jwt } = state['features/base/jwt'];
const connection
= new JitsiMeetJS.JitsiConnection(
options.appId,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import { SET_CALL_OVERLAY_VISIBLE, SET_JWT } from './actionTypes';
*/
export function setCallOverlayVisible(callOverlayVisible: boolean) {
return (dispatch: Dispatch<*>, getState: Function) => {
getState()['features/jwt'].callOverlayVisible === callOverlayVisible
getState()['features/base/jwt']
.callOverlayVisible === callOverlayVisible
|| dispatch({
type: SET_CALL_OVERLAY_VISIBLE,
callOverlayVisible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';

import { Audio } from '../../base/media';
import { Avatar } from '../../base/participants';
import { Container, Text } from '../../base/react';
import UIEvents from '../../../../service/UI/UIEvents';
import { Audio } from '../../media';
import { Avatar } from '../../participants';
import { Container, Text } from '../../react';
import UIEvents from '../../../../../service/UI/UIEvents';

import styles from './styles';

Expand Down Expand Up @@ -335,7 +335,7 @@ function _mapStateToProps(state) {
* @private
* @type {Object}
*/
_callee: state['features/jwt'].callee
_callee: state['features/base/jwt'].callee
};
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ColorPalette, createStyleSheet } from '../../base/styles';
import { ColorPalette, createStyleSheet } from '../../styles';

export default createStyleSheet({
// XXX The names bellow were preserved for the purposes of compatibility
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import { parseURLParams } from '../base/config';
import { parseURLParams } from '../config';

/**
* Retrieves the JSON Web Token (JWT), if any, defined by a specific
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import {
CONFERENCE_LEFT,
CONFERENCE_WILL_LEAVE,
SET_ROOM
} from '../base/conference';
import { SET_CONFIG } from '../base/config';
import { SET_LOCATION_URL } from '../base/connection';
import { LIB_INIT_ERROR } from '../base/lib-jitsi-meet';
} from '../conference';
import { SET_CONFIG } from '../config';
import { SET_LOCATION_URL } from '../connection';
import { LIB_INIT_ERROR } from '../lib-jitsi-meet';
import {
getLocalParticipant,
getParticipantCount,
PARTICIPANT_JOINED
} from '../base/participants';
import { MiddlewareRegistry } from '../base/redux';
} from '../participants';
import { MiddlewareRegistry } from '../redux';

import { setCallOverlayVisible, setJWT } from './actions';
import { SET_JWT } from './actionTypes';
Expand Down Expand Up @@ -72,7 +72,7 @@ function _maybeSetCallOverlayVisible({ dispatch, getState }, next, action) {
const result = next(action);

const state = getState();
const stateFeaturesJWT = state['features/jwt'];
const stateFeaturesJWT = state['features/base/jwt'];
let callOverlayVisible;

if (stateFeaturesJWT.callee) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { equals, set, ReducerRegistry } from '../base/redux';
import { equals, set, ReducerRegistry } from '../redux';

import { SET_CALL_OVERLAY_VISIBLE, SET_JWT } from './actionTypes';

Expand Down Expand Up @@ -37,7 +37,8 @@ const _INITIAL_STATE = {
* @returns {Object} The next redux state which is the result of reducing the
* specified {@code action}.
*/
ReducerRegistry.register('features/jwt', (state = _INITIAL_STATE, action) => {
ReducerRegistry.register(
'features/base/jwt', (state = _INITIAL_STATE, action) => {
switch (action.type) {
case SET_CALL_OVERLAY_VISIBLE:
return set(state, 'callOverlayVisible', action.callOverlayVisible);
Expand Down
2 changes: 1 addition & 1 deletion react/features/base/react/components/web/Watermarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class Watermarks extends Component {
* }}
*/
function _mapStateToProps(state) {
const { isGuest } = state['features/jwt'];
const { isGuest } = state['features/base/jwt'];

return {
/**
Expand Down
2 changes: 1 addition & 1 deletion react/features/conference/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function _obtainConfigHandler() {
*/
function _setTokenData() {
const state = APP.store.getState();
const { caller } = state['features/jwt'];
const { caller } = state['features/base/jwt'];

if (caller) {
const { avatarUrl, avatar, email, name } = caller;
Expand Down
6 changes: 3 additions & 3 deletions react/features/filmstrip/middleware.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* @flow */

import { MiddlewareRegistry } from '../base/redux';
import { SET_CALL_OVERLAY_VISIBLE } from '../jwt';
import { SET_CALL_OVERLAY_VISIBLE } from '../base/jwt';

import Filmstrip from '../../../modules/UI/videolayout/Filmstrip';

Expand All @@ -13,10 +13,10 @@ MiddlewareRegistry.register(({ getState }) => next => action => {
case SET_CALL_OVERLAY_VISIBLE:
if (typeof APP !== 'undefined') {
const oldValue
= Boolean(getState()['features/jwt'].callOverlayVisible);
= Boolean(getState()['features/base/jwt'].callOverlayVisible);
const result = next(action);
const newValue
= Boolean(getState()['features/jwt'].callOverlayVisible);
= Boolean(getState()['features/base/jwt'].callOverlayVisible);

oldValue === newValue

Expand Down
2 changes: 1 addition & 1 deletion react/features/invite/components/AddPeopleDialog.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ function _mapStateToProps(state) {
_conference: conference,
_inviteServiceUrl: inviteServiceUrl,
_inviteUrl: getInviteURL(state),
_jwt: state['features/jwt'].jwt,
_jwt: state['features/base/jwt'].jwt,
_peopleSearchQueryTypes: peopleSearchQueryTypes,
_peopleSearchUrl: peopleSearchUrl
};
Expand Down
2 changes: 1 addition & 1 deletion react/features/invite/components/InfoDialog.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class InfoDialog extends Component {
function _mapStateToProps(state) {
return {
_inviteURL: getInviteURL(state),
_showAddPeople: !state['features/jwt'].isGuest
_showAddPeople: !state['features/base/jwt'].isGuest
};
}

Expand Down
2 changes: 1 addition & 1 deletion react/features/invite/components/InviteButton.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class InviteButton extends Component {
function _mapStateToProps(state) {
const { conference } = state['features/base/conference'];
const { enableUserRolesBasedOnToken } = state['features/base/config'];
const { isGuest } = state['features/jwt'];
const { isGuest } = state['features/base/jwt'];

return {
_isAddToCallAvailable:
Expand Down
2 changes: 1 addition & 1 deletion react/features/mobile/callkit/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function _conferenceWillJoin({ getState }, next, action) {
CallKit.startCall(conference.callUUID, url.toString(), hasVideo)
.then(() => {
const { room } = state['features/base/conference'];
const { callee } = state['features/jwt'];
const { callee } = state['features/base/jwt'];

CallKit.updateCall(
conference.callUUID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function _mapStateToProps(state) {
const isAnyOverlayVisible = (connectionEstablished && haveToReload)
|| isMediaPermissionPromptVisible
|| suspendDetected
|| state['features/jwt'].callOverlayVisible;
|| state['features/base/jwt'].callOverlayVisible;

const { enabled, notifications } = state['features/notifications'];

Expand Down
5 changes: 3 additions & 2 deletions react/features/overlay/components/OverlayContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';

import { CallOverlay } from '../../jwt';
import { CallOverlay } from '../../base/jwt';

import PageReloadFilmstripOnlyOverlay from './PageReloadFilmstripOnlyOverlay';
import PageReloadOverlay from './PageReloadOverlay';
Expand Down Expand Up @@ -214,7 +214,8 @@ function _mapStateToProps(state) {
* @private
* @type {boolean}
*/
_callOverlayVisible: Boolean(state['features/jwt'].callOverlayVisible),
_callOverlayVisible:
Boolean(state['features/base/jwt'].callOverlayVisible),

/**
* The indicator which determines whether the status of the
Expand Down
2 changes: 1 addition & 1 deletion react/features/toolbox/actions.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export function hideToolbox(force: boolean = false): Function {

if (!force
&& (hovered
|| state['features/jwt'].callOverlayVisible
|| state['features/base/jwt'].callOverlayVisible
|| SideContainerToggler.isVisible())) {
dispatch(
setToolboxTimeout(
Expand Down
2 changes: 1 addition & 1 deletion react/features/toolbox/components/ProfileButton.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class ProfileButton extends Component {
*/
function _mapStateToProps(state) {
return {
_unclickable: !state['features/jwt'].isGuest
_unclickable: !state['features/base/jwt'].isGuest
};
}

Expand Down
2 changes: 1 addition & 1 deletion react/features/toolbox/components/SecondaryToolbar.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function _mapDispatchToProps(dispatch: Function): Object {
* @private
*/
function _mapStateToProps(state: Object): Object {
const { isGuest } = state['features/jwt'];
const { isGuest } = state['features/base/jwt'];
const { secondaryToolbarButtons, visible } = state['features/toolbox'];
const { callStatsID } = state['features/base/config'];

Expand Down

0 comments on commit 122be9e

Please sign in to comment.