|
|
|
@ -41,23 +41,24 @@ const DEFAULT_STATE = { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export interface IConferenceState { |
|
|
|
|
authEnabled?: boolean|undefined; |
|
|
|
|
authLogin?: string|undefined; |
|
|
|
|
authEnabled?: boolean; |
|
|
|
|
authLogin?: string; |
|
|
|
|
authRequired?: Object; |
|
|
|
|
conference: any|undefined; |
|
|
|
|
conference?: any; |
|
|
|
|
conferenceTimestamp?: number; |
|
|
|
|
e2eeSupported: boolean|undefined; |
|
|
|
|
e2eeSupported?: boolean; |
|
|
|
|
error?: Error; |
|
|
|
|
followMeEnabled?: boolean; |
|
|
|
|
joining: Object|undefined; |
|
|
|
|
leaving: Object|undefined; |
|
|
|
|
joining?: Object; |
|
|
|
|
leaving?: Object; |
|
|
|
|
localSubject?: string; |
|
|
|
|
locked: string|undefined; |
|
|
|
|
membersOnly: boolean|undefined; |
|
|
|
|
locked?: string; |
|
|
|
|
membersOnly?: Object; |
|
|
|
|
obfuscatedRoom?: string; |
|
|
|
|
obfuscatedRoomSource?: string; |
|
|
|
|
p2p?: Object; |
|
|
|
|
password: string|undefined; |
|
|
|
|
passwordRequired: boolean|undefined; |
|
|
|
|
password?: string; |
|
|
|
|
passwordRequired?: Object; |
|
|
|
|
pendingSubjectChange?: string; |
|
|
|
|
room?: Object; |
|
|
|
|
startAudioMutedPolicy?: boolean; |
|
|
|
@ -152,7 +153,8 @@ ReducerRegistry.register<IConferenceState>('features/base/conference', |
|
|
|
|
* @returns {Object} The new state of the feature base/conference after the |
|
|
|
|
* reduction of the specified action. |
|
|
|
|
*/ |
|
|
|
|
function _authStatusChanged(state: any, { authEnabled, authLogin }: {authEnabled: boolean, authLogin: string}) { |
|
|
|
|
function _authStatusChanged(state: IConferenceState, |
|
|
|
|
{ authEnabled, authLogin }: { authEnabled: boolean, authLogin: string }) { |
|
|
|
|
return assign(state, { |
|
|
|
|
authEnabled, |
|
|
|
|
authLogin |
|
|
|
@ -169,7 +171,7 @@ function _authStatusChanged(state: any, { authEnabled, authLogin }: {authEnabled |
|
|
|
|
* @returns {Object} The new state of the feature base/conference after the |
|
|
|
|
* reduction of the specified action. |
|
|
|
|
*/ |
|
|
|
|
function _conferenceFailed(state: any, { conference, error }: {conference: Object, error: any}) { |
|
|
|
|
function _conferenceFailed(state: IConferenceState, { conference, error }: { conference: Object, error: Error }) { |
|
|
|
|
// The current (similar to getCurrentConference in
|
|
|
|
|
// base/conference/functions.any.js) conference which is joining or joined:
|
|
|
|
|
const conference_ = state.conference || state.joining; |
|
|
|
@ -235,7 +237,7 @@ function _conferenceFailed(state: any, { conference, error }: {conference: Objec |
|
|
|
|
* @returns {Object} The new state of the feature base/conference after the |
|
|
|
|
* reduction of the specified action. |
|
|
|
|
*/ |
|
|
|
|
function _conferenceJoined(state: any, { conference }: {conference: any}) { |
|
|
|
|
function _conferenceJoined(state: IConferenceState, { conference }: { conference: any }) { |
|
|
|
|
// FIXME The indicator which determines whether a JitsiConference is locked
|
|
|
|
|
// i.e. password-protected is private to lib-jitsi-meet. However, the
|
|
|
|
|
// library does not fire LOCK_STATE_CHANGED upon joining a JitsiConference
|
|
|
|
@ -281,7 +283,8 @@ function _conferenceJoined(state: any, { conference }: {conference: any}) { |
|
|
|
|
* @returns {Object} The next/new state of the feature base/conference after the |
|
|
|
|
* reduction of the specified action. |
|
|
|
|
*/ |
|
|
|
|
function _conferenceLeftOrWillLeave(state: any, { conference, type }: {conference: Object, type: string}) { |
|
|
|
|
function _conferenceLeftOrWillLeave(state: IConferenceState, { conference, type }: |
|
|
|
|
{ conference: Object, type: string }) { |
|
|
|
|
const nextState = { ...state }; |
|
|
|
|
|
|
|
|
|
// The redux action CONFERENCE_LEFT is the last time that we should be
|
|
|
|
@ -293,8 +296,8 @@ function _conferenceLeftOrWillLeave(state: any, { conference, type }: {conferenc |
|
|
|
|
// due clean-up like leaving the associated room, but the instance is no
|
|
|
|
|
// longer the focus of the attention of the user and, consequently, the app.
|
|
|
|
|
for (const p in state) { |
|
|
|
|
if (state[p] === conference) { |
|
|
|
|
nextState[p] = undefined; |
|
|
|
|
if (state[p as keyof IConferenceState] === conference) { |
|
|
|
|
nextState[p as keyof IConferenceState] = undefined; |
|
|
|
|
|
|
|
|
|
switch (p) { |
|
|
|
|
case 'conference': |
|
|
|
@ -335,7 +338,7 @@ function _conferenceLeftOrWillLeave(state: any, { conference, type }: {conferenc |
|
|
|
|
* @returns {Object} The new state of the feature base/conference after the |
|
|
|
|
* reduction of the specified action. |
|
|
|
|
*/ |
|
|
|
|
function _conferenceWillJoin(state: any, { conference }: {conference: Object}) { |
|
|
|
|
function _conferenceWillJoin(state: IConferenceState, { conference }: { conference: Object }) { |
|
|
|
|
return assign(state, { |
|
|
|
|
error: undefined, |
|
|
|
|
joining: conference |
|
|
|
@ -352,7 +355,7 @@ function _conferenceWillJoin(state: any, { conference }: {conference: Object}) { |
|
|
|
|
* @returns {Object} The new state of the feature base/conference after the |
|
|
|
|
* reduction of the specified action. |
|
|
|
|
*/ |
|
|
|
|
function _lockStateChanged(state: any, { conference, locked }: {conference: Object, locked: boolean}) { |
|
|
|
|
function _lockStateChanged(state: IConferenceState, { conference, locked }: { conference: Object, locked: boolean }) { |
|
|
|
|
if (state.conference !== conference) { |
|
|
|
|
return state; |
|
|
|
|
} |
|
|
|
@ -373,7 +376,7 @@ function _lockStateChanged(state: any, { conference, locked }: {conference: Obje |
|
|
|
|
* @returns {Object} The new state of the feature base/conference after the |
|
|
|
|
* reduction of the specified action. |
|
|
|
|
*/ |
|
|
|
|
function _p2pStatusChanged(state: any, action: any) { |
|
|
|
|
function _p2pStatusChanged(state: IConferenceState, action: any) { |
|
|
|
|
return set(state, 'p2p', action.p2p); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -386,8 +389,8 @@ function _p2pStatusChanged(state: any, action: any) { |
|
|
|
|
* @returns {Object} The new state of the feature base/conference after the |
|
|
|
|
* reduction of the specified action. |
|
|
|
|
*/ |
|
|
|
|
function _setPassword(state: any, { conference, method, password } |
|
|
|
|
: {conference: any, method: Object, password: string}) { |
|
|
|
|
function _setPassword(state: IConferenceState, { conference, method, password } |
|
|
|
|
: { conference: any, method: Object, password: string }) { |
|
|
|
|
switch (method) { |
|
|
|
|
case conference.join: |
|
|
|
|
return assign(state, { |
|
|
|
@ -434,7 +437,7 @@ function _setPassword(state: any, { conference, method, password } |
|
|
|
|
* @returns {Object} The new state of the feature base/conference after the |
|
|
|
|
* reduction of the specified action. |
|
|
|
|
*/ |
|
|
|
|
function _setRoom(state: any, action: any) { |
|
|
|
|
function _setRoom(state: IConferenceState, action: any) { |
|
|
|
|
let { room } = action; |
|
|
|
|
|
|
|
|
|
if (!isRoomValid(room)) { |
|
|
|
|