|
|
|
@ -1,42 +1,37 @@ |
|
|
|
|
// @flow
|
|
|
|
|
|
|
|
|
|
import type { Dispatch } from 'redux'; |
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
createStartMutedConfigurationEvent, |
|
|
|
|
sendAnalytics |
|
|
|
|
} from '../../analytics'; |
|
|
|
|
/* eslint-disable lines-around-comment */ |
|
|
|
|
import { createStartMutedConfigurationEvent } from '../../analytics/AnalyticsEvents'; |
|
|
|
|
import { sendAnalytics } from '../../analytics/functions'; |
|
|
|
|
// @ts-ignore
|
|
|
|
|
import { appNavigate } from '../../app/actions'; |
|
|
|
|
import { endpointMessageReceived } from '../../subtitles'; |
|
|
|
|
import { IState, IStore } from '../../app/types'; |
|
|
|
|
import { endpointMessageReceived } from '../../subtitles/actions.any'; |
|
|
|
|
// @ts-ignore
|
|
|
|
|
import { getReplaceParticipant } from '../config/functions'; |
|
|
|
|
import { JITSI_CONNECTION_CONFERENCE_KEY, disconnect } from '../connection'; |
|
|
|
|
// @ts-ignore
|
|
|
|
|
import { disconnect } from '../connection/actions'; |
|
|
|
|
import { JITSI_CONNECTION_CONFERENCE_KEY } from '../connection/constants'; |
|
|
|
|
import { JitsiConferenceEvents, JitsiE2ePingEvents } from '../lib-jitsi-meet'; |
|
|
|
|
import { |
|
|
|
|
MEDIA_TYPE, |
|
|
|
|
setAudioMuted, |
|
|
|
|
setAudioUnmutePermissions, |
|
|
|
|
setVideoMuted, |
|
|
|
|
setVideoUnmutePermissions |
|
|
|
|
} from '../media'; |
|
|
|
|
import { setAudioMuted, setAudioUnmutePermissions, setVideoMuted, setVideoUnmutePermissions } from '../media/actions'; |
|
|
|
|
import { MEDIA_TYPE } from '../media/constants'; |
|
|
|
|
import { |
|
|
|
|
dominantSpeakerChanged, |
|
|
|
|
getNormalizedDisplayName, |
|
|
|
|
participantConnectionStatusChanged, |
|
|
|
|
participantKicked, |
|
|
|
|
participantMutedUs, |
|
|
|
|
participantPresenceChanged, |
|
|
|
|
participantRoleChanged, |
|
|
|
|
participantUpdated |
|
|
|
|
} from '../participants'; |
|
|
|
|
import { toState } from '../redux'; |
|
|
|
|
} from '../participants/actions'; |
|
|
|
|
import { getNormalizedDisplayName } from '../participants/functions'; |
|
|
|
|
import { toState } from '../redux/functions'; |
|
|
|
|
import { |
|
|
|
|
destroyLocalTracks, |
|
|
|
|
getLocalTracks, |
|
|
|
|
replaceLocalTrack, |
|
|
|
|
trackAdded, |
|
|
|
|
trackRemoved |
|
|
|
|
} from '../tracks'; |
|
|
|
|
import { getBackendSafeRoomName } from '../util'; |
|
|
|
|
} from '../tracks/actions.any'; |
|
|
|
|
import { getLocalTracks } from '../tracks/functions'; |
|
|
|
|
import { getBackendSafeRoomName } from '../util/uri'; |
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
AUTH_STATUS_CHANGED, |
|
|
|
@ -81,8 +76,7 @@ import { |
|
|
|
|
sendLocalParticipant |
|
|
|
|
} from './functions'; |
|
|
|
|
import logger from './logger'; |
|
|
|
|
|
|
|
|
|
declare var APP: Object; |
|
|
|
|
import { IJitsiConference } from './reducer'; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Adds conference (event) listeners. |
|
|
|
@ -93,52 +87,53 @@ declare var APP: Object; |
|
|
|
|
* @private |
|
|
|
|
* @returns {void} |
|
|
|
|
*/ |
|
|
|
|
function _addConferenceListeners(conference, dispatch, state) { |
|
|
|
|
function _addConferenceListeners(conference: IJitsiConference, dispatch: IStore['dispatch'], state: IState) { |
|
|
|
|
// A simple logger for conference errors received through
|
|
|
|
|
// the listener. These errors are not handled now, but logged.
|
|
|
|
|
conference.on(JitsiConferenceEvents.CONFERENCE_ERROR, |
|
|
|
|
error => logger.error('Conference error.', error)); |
|
|
|
|
(error: Error) => logger.error('Conference error.', error)); |
|
|
|
|
|
|
|
|
|
// Dispatches into features/base/conference follow:
|
|
|
|
|
|
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.AUTH_STATUS_CHANGED, |
|
|
|
|
(authEnabled, authLogin) => dispatch(authStatusChanged(authEnabled, authLogin))); |
|
|
|
|
(authEnabled: boolean, authLogin: string) => dispatch(authStatusChanged(authEnabled, authLogin))); |
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.CONFERENCE_FAILED, |
|
|
|
|
(...args) => dispatch(conferenceFailed(conference, ...args))); |
|
|
|
|
JitsiConferenceEvents.CONFERENCE_FAILED, // @ts-ignore
|
|
|
|
|
(...args: any[]) => dispatch(conferenceFailed(conference, ...args))); |
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.CONFERENCE_JOINED, |
|
|
|
|
(...args) => dispatch(conferenceJoined(conference, ...args))); |
|
|
|
|
JitsiConferenceEvents.CONFERENCE_JOINED, // @ts-ignore
|
|
|
|
|
(...args: any[]) => dispatch(conferenceJoined(conference, ...args))); |
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.CONFERENCE_UNIQUE_ID_SET, |
|
|
|
|
(...args) => dispatch(conferenceUniqueIdSet(conference, ...args))); |
|
|
|
|
JitsiConferenceEvents.CONFERENCE_UNIQUE_ID_SET, // @ts-ignore
|
|
|
|
|
(...args: any[]) => dispatch(conferenceUniqueIdSet(conference, ...args))); |
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.CONFERENCE_JOIN_IN_PROGRESS, |
|
|
|
|
(...args) => dispatch(conferenceJoinInProgress(conference, ...args))); |
|
|
|
|
JitsiConferenceEvents.CONFERENCE_JOIN_IN_PROGRESS, // @ts-ignore
|
|
|
|
|
(...args: any[]) => dispatch(conferenceJoinInProgress(conference, ...args))); |
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.CONFERENCE_LEFT, |
|
|
|
|
(...args) => { |
|
|
|
|
(...args: any[]) => { |
|
|
|
|
dispatch(conferenceTimestampChanged(0)); |
|
|
|
|
// @ts-ignore
|
|
|
|
|
dispatch(conferenceLeft(conference, ...args)); |
|
|
|
|
}); |
|
|
|
|
conference.on(JitsiConferenceEvents.SUBJECT_CHANGED, |
|
|
|
|
(...args) => dispatch(conferenceSubjectChanged(...args))); |
|
|
|
|
conference.on(JitsiConferenceEvents.SUBJECT_CHANGED, // @ts-ignore
|
|
|
|
|
(...args: any[]) => dispatch(conferenceSubjectChanged(...args))); |
|
|
|
|
|
|
|
|
|
conference.on(JitsiConferenceEvents.CONFERENCE_CREATED_TIMESTAMP, |
|
|
|
|
(...args) => dispatch(conferenceTimestampChanged(...args))); |
|
|
|
|
conference.on(JitsiConferenceEvents.CONFERENCE_CREATED_TIMESTAMP, // @ts-ignore
|
|
|
|
|
(...args: any[]) => dispatch(conferenceTimestampChanged(...args))); |
|
|
|
|
|
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.KICKED, |
|
|
|
|
(...args) => dispatch(kickedOut(conference, ...args))); |
|
|
|
|
JitsiConferenceEvents.KICKED, // @ts-ignore
|
|
|
|
|
(...args: any[]) => dispatch(kickedOut(conference, ...args))); |
|
|
|
|
|
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.PARTICIPANT_KICKED, |
|
|
|
|
(kicker, kicked) => dispatch(participantKicked(kicker, kicked))); |
|
|
|
|
(kicker: any, kicked: any) => dispatch(participantKicked(kicker, kicked))); |
|
|
|
|
|
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.LOCK_STATE_CHANGED, |
|
|
|
|
(...args) => dispatch(lockStateChanged(conference, ...args))); |
|
|
|
|
JitsiConferenceEvents.LOCK_STATE_CHANGED, // @ts-ignore
|
|
|
|
|
(...args: any[]) => dispatch(lockStateChanged(conference, ...args))); |
|
|
|
|
|
|
|
|
|
// Dispatches into features/base/media follow:
|
|
|
|
|
|
|
|
|
@ -177,12 +172,12 @@ function _addConferenceListeners(conference, dispatch, state) { |
|
|
|
|
|
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.AUDIO_UNMUTE_PERMISSIONS_CHANGED, |
|
|
|
|
disableAudioMuteChange => { |
|
|
|
|
(disableAudioMuteChange: boolean) => { |
|
|
|
|
dispatch(setAudioUnmutePermissions(disableAudioMuteChange)); |
|
|
|
|
}); |
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.VIDEO_UNMUTE_PERMISSIONS_CHANGED, |
|
|
|
|
disableVideoMuteChange => { |
|
|
|
|
(disableVideoMuteChange: boolean) => { |
|
|
|
|
dispatch(setVideoUnmutePermissions(disableVideoMuteChange)); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -190,25 +185,25 @@ function _addConferenceListeners(conference, dispatch, state) { |
|
|
|
|
|
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.TRACK_ADDED, |
|
|
|
|
t => t && !t.isLocal() && dispatch(trackAdded(t))); |
|
|
|
|
(t: any) => t && !t.isLocal() && dispatch(trackAdded(t))); |
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.TRACK_REMOVED, |
|
|
|
|
t => t && !t.isLocal() && dispatch(trackRemoved(t))); |
|
|
|
|
(t: any) => t && !t.isLocal() && dispatch(trackRemoved(t))); |
|
|
|
|
|
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.TRACK_MUTE_CHANGED, |
|
|
|
|
(track, participantThatMutedUs) => { |
|
|
|
|
(track: any, participantThatMutedUs: any) => { |
|
|
|
|
if (participantThatMutedUs) { |
|
|
|
|
dispatch(participantMutedUs(participantThatMutedUs, track)); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
conference.on(JitsiConferenceEvents.TRACK_UNMUTE_REJECTED, track => dispatch(destroyLocalTracks(track))); |
|
|
|
|
conference.on(JitsiConferenceEvents.TRACK_UNMUTE_REJECTED, (track: any) => dispatch(destroyLocalTracks(track))); |
|
|
|
|
|
|
|
|
|
// Dispatches into features/base/participants follow:
|
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.DISPLAY_NAME_CHANGED, |
|
|
|
|
(id, displayName) => dispatch(participantUpdated({ |
|
|
|
|
(id: string, displayName: string) => dispatch(participantUpdated({ |
|
|
|
|
conference, |
|
|
|
|
id, |
|
|
|
|
name: getNormalizedDisplayName(displayName) |
|
|
|
@ -216,42 +211,42 @@ function _addConferenceListeners(conference, dispatch, state) { |
|
|
|
|
|
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED, |
|
|
|
|
(dominant, previous, silence) => { |
|
|
|
|
(dominant: string, previous: string[], silence: boolean | string) => { |
|
|
|
|
dispatch(dominantSpeakerChanged(dominant, previous, Boolean(silence), conference)); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED, |
|
|
|
|
(...args) => dispatch(endpointMessageReceived(...args))); |
|
|
|
|
JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED, // @ts-ignore
|
|
|
|
|
(...args: any[]) => dispatch(endpointMessageReceived(...args))); |
|
|
|
|
|
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.NON_PARTICIPANT_MESSAGE_RECEIVED, |
|
|
|
|
(...args) => dispatch(nonParticipantMessageReceived(...args))); |
|
|
|
|
JitsiConferenceEvents.NON_PARTICIPANT_MESSAGE_RECEIVED, // @ts-ignore
|
|
|
|
|
(...args: any[]) => dispatch(nonParticipantMessageReceived(...args))); |
|
|
|
|
|
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED, |
|
|
|
|
(...args) => dispatch(participantConnectionStatusChanged(...args))); |
|
|
|
|
JitsiConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED, // @ts-ignore
|
|
|
|
|
(...args: any[]) => dispatch(participantConnectionStatusChanged(...args))); |
|
|
|
|
|
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.USER_JOINED, |
|
|
|
|
(id, user) => commonUserJoinedHandling({ dispatch }, conference, user)); |
|
|
|
|
(_id: string, user: any) => commonUserJoinedHandling({ dispatch }, conference, user)); |
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.USER_LEFT, |
|
|
|
|
(id, user) => commonUserLeftHandling({ dispatch }, conference, user)); |
|
|
|
|
(_id: string, user: any) => commonUserLeftHandling({ dispatch }, conference, user)); |
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.USER_ROLE_CHANGED, |
|
|
|
|
(...args) => dispatch(participantRoleChanged(...args))); |
|
|
|
|
JitsiConferenceEvents.USER_ROLE_CHANGED, // @ts-ignore
|
|
|
|
|
(...args: any[]) => dispatch(participantRoleChanged(...args))); |
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.USER_STATUS_CHANGED, |
|
|
|
|
(...args) => dispatch(participantPresenceChanged(...args))); |
|
|
|
|
JitsiConferenceEvents.USER_STATUS_CHANGED, // @ts-ignore
|
|
|
|
|
(...args: any[]) => dispatch(participantPresenceChanged(...args))); |
|
|
|
|
|
|
|
|
|
conference.on( |
|
|
|
|
JitsiE2ePingEvents.E2E_RTT_CHANGED, |
|
|
|
|
(...args) => dispatch(e2eRttChanged(...args))); |
|
|
|
|
JitsiE2ePingEvents.E2E_RTT_CHANGED, // @ts-ignore
|
|
|
|
|
(...args: any[]) => dispatch(e2eRttChanged(...args))); |
|
|
|
|
|
|
|
|
|
conference.on( |
|
|
|
|
JitsiConferenceEvents.BOT_TYPE_CHANGED, |
|
|
|
|
(id, botType) => dispatch(participantUpdated({ |
|
|
|
|
(id: string, botType: string) => dispatch(participantUpdated({ |
|
|
|
|
conference, |
|
|
|
|
id, |
|
|
|
|
botType |
|
|
|
@ -259,14 +254,14 @@ function _addConferenceListeners(conference, dispatch, state) { |
|
|
|
|
|
|
|
|
|
conference.addCommandListener( |
|
|
|
|
AVATAR_URL_COMMAND, |
|
|
|
|
(data, id) => dispatch(participantUpdated({ |
|
|
|
|
(data: { value: string; }, id: string) => dispatch(participantUpdated({ |
|
|
|
|
conference, |
|
|
|
|
id, |
|
|
|
|
avatarURL: data.value |
|
|
|
|
}))); |
|
|
|
|
conference.addCommandListener( |
|
|
|
|
EMAIL_COMMAND, |
|
|
|
|
(data, id) => dispatch(participantUpdated({ |
|
|
|
|
(data: { value: string; }, id: string) => dispatch(participantUpdated({ |
|
|
|
|
conference, |
|
|
|
|
id, |
|
|
|
|
email: data.value |
|
|
|
@ -287,7 +282,7 @@ function _addConferenceListeners(conference, dispatch, state) { |
|
|
|
|
* } |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
export function e2eRttChanged(participant, rtt) { |
|
|
|
|
export function e2eRttChanged(participant: Object, rtt: number) { |
|
|
|
|
return { |
|
|
|
|
type: E2E_RTT_CHANGED, |
|
|
|
|
e2eRtt: { |
|
|
|
@ -331,7 +326,7 @@ export function authStatusChanged(authEnabled: boolean, authLogin: string) { |
|
|
|
|
* }} |
|
|
|
|
* @public |
|
|
|
|
*/ |
|
|
|
|
export function conferenceFailed(conference: Object, error: string, ...params: any) { |
|
|
|
|
export function conferenceFailed(conference: IJitsiConference, error: string, ...params: any) { |
|
|
|
|
return { |
|
|
|
|
type: CONFERENCE_FAILED, |
|
|
|
|
conference, |
|
|
|
@ -356,7 +351,7 @@ export function conferenceFailed(conference: Object, error: string, ...params: a |
|
|
|
|
* conference: JitsiConference |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
export function conferenceJoined(conference: Object) { |
|
|
|
|
export function conferenceJoined(conference: IJitsiConference) { |
|
|
|
|
return { |
|
|
|
|
type: CONFERENCE_JOINED, |
|
|
|
|
conference |
|
|
|
@ -373,7 +368,7 @@ export function conferenceJoined(conference: Object) { |
|
|
|
|
* conference: JitsiConference |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
export function conferenceJoinInProgress(conference: Object) { |
|
|
|
|
export function conferenceJoinInProgress(conference: IJitsiConference) { |
|
|
|
|
return { |
|
|
|
|
type: CONFERENCE_JOIN_IN_PROGRESS, |
|
|
|
|
conference |
|
|
|
@ -390,7 +385,7 @@ export function conferenceJoinInProgress(conference: Object) { |
|
|
|
|
* conference: JitsiConference |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
export function conferenceLeft(conference: Object) { |
|
|
|
|
export function conferenceLeft(conference: IJitsiConference) { |
|
|
|
|
return { |
|
|
|
|
type: CONFERENCE_LEFT, |
|
|
|
|
conference |
|
|
|
@ -438,7 +433,7 @@ export function conferenceTimestampChanged(conferenceTimestamp: number) { |
|
|
|
|
* conference: JitsiConference, |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
export function conferenceUniqueIdSet(conference: Object) { |
|
|
|
|
export function conferenceUniqueIdSet(conference: IJitsiConference) { |
|
|
|
|
return { |
|
|
|
|
type: CONFERENCE_UNIQUE_ID_SET, |
|
|
|
|
conference |
|
|
|
@ -454,8 +449,8 @@ export function conferenceUniqueIdSet(conference: Object) { |
|
|
|
|
* the local participant will (try to) join. |
|
|
|
|
* @returns {Function} |
|
|
|
|
*/ |
|
|
|
|
export function _conferenceWillJoin(conference: Object) { |
|
|
|
|
return (dispatch: Dispatch<any>, getState: Function) => { |
|
|
|
|
export function _conferenceWillJoin(conference: IJitsiConference) { |
|
|
|
|
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => { |
|
|
|
|
const localTracks |
|
|
|
|
= getLocalTracks(getState()['features/base/tracks']) |
|
|
|
|
.map(t => t.jitsiTrack); |
|
|
|
@ -479,7 +474,7 @@ export function _conferenceWillJoin(conference: Object) { |
|
|
|
|
* conference: JitsiConference |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
export function conferenceWillJoin(conference: Object) { |
|
|
|
|
export function conferenceWillJoin(conference: IJitsiConference) { |
|
|
|
|
return { |
|
|
|
|
type: CONFERENCE_WILL_JOIN, |
|
|
|
|
conference |
|
|
|
@ -499,7 +494,7 @@ export function conferenceWillJoin(conference: Object) { |
|
|
|
|
* conference: JitsiConference |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
export function conferenceWillLeave(conference: Object) { |
|
|
|
|
export function conferenceWillLeave(conference: IJitsiConference) { |
|
|
|
|
return { |
|
|
|
|
type: CONFERENCE_WILL_LEAVE, |
|
|
|
|
conference |
|
|
|
@ -514,7 +509,7 @@ export function conferenceWillLeave(conference: Object) { |
|
|
|
|
* @returns {Function} |
|
|
|
|
*/ |
|
|
|
|
export function createConference(overrideRoom?: string) { |
|
|
|
|
return (dispatch: Function, getState: Function) => { |
|
|
|
|
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => { |
|
|
|
|
const state = getState(); |
|
|
|
|
const { connection, locationURL } = state['features/base/connection']; |
|
|
|
|
|
|
|
|
@ -530,8 +525,8 @@ export function createConference(overrideRoom?: string) { |
|
|
|
|
|
|
|
|
|
// XXX: revisit this.
|
|
|
|
|
// Hide the custom domain in the room name.
|
|
|
|
|
const tmp = overrideRoom || room; |
|
|
|
|
let _room = getBackendSafeRoomName(tmp); |
|
|
|
|
const tmp: any = overrideRoom || room; |
|
|
|
|
let _room: any = getBackendSafeRoomName(tmp); |
|
|
|
|
|
|
|
|
|
if (tmp.domain) { |
|
|
|
|
// eslint-disable-next-line no-new-wrappers
|
|
|
|
@ -543,6 +538,7 @@ export function createConference(overrideRoom?: string) { |
|
|
|
|
|
|
|
|
|
const conference = connection.initJitsiConference(_room, getConferenceOptions(state)); |
|
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
connection[JITSI_CONNECTION_CONFERENCE_KEY] = conference; |
|
|
|
|
|
|
|
|
|
conference[JITSI_CONFERENCE_URL_KEY] = locationURL; |
|
|
|
@ -568,14 +564,15 @@ export function createConference(overrideRoom?: string) { |
|
|
|
|
* @returns {Function} |
|
|
|
|
*/ |
|
|
|
|
export function checkIfCanJoin() { |
|
|
|
|
return (dispatch: Function, getState: Function) => { |
|
|
|
|
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => { |
|
|
|
|
const { authRequired, password } |
|
|
|
|
= getState()['features/base/conference']; |
|
|
|
|
|
|
|
|
|
const replaceParticipant = getReplaceParticipant(getState()); |
|
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
authRequired && dispatch(_conferenceWillJoin(authRequired)); |
|
|
|
|
authRequired && authRequired.join(password, replaceParticipant); |
|
|
|
|
authRequired?.join(password, replaceParticipant); |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -598,7 +595,7 @@ export function dataChannelOpened() { |
|
|
|
|
* @returns {Function} |
|
|
|
|
*/ |
|
|
|
|
export function endConference() { |
|
|
|
|
return async (dispatch: Dispatch<any>, getState: Function) => { |
|
|
|
|
return async (dispatch: IStore['dispatch'], getState: IStore['getState']) => { |
|
|
|
|
const { conference } = getConferenceState(toState(getState)); |
|
|
|
|
|
|
|
|
|
conference?.end(); |
|
|
|
@ -633,7 +630,7 @@ export function kickedOut(conference: Object, participant: Object) { |
|
|
|
|
* @returns {Function} |
|
|
|
|
*/ |
|
|
|
|
export function leaveConference() { |
|
|
|
|
return async (dispatch: Dispatch<any>) => { |
|
|
|
|
return async (dispatch: IStore['dispatch']) => { |
|
|
|
|
|
|
|
|
|
// FIXME: these should be unified.
|
|
|
|
|
if (navigator.product === 'ReactNative') { |
|
|
|
@ -771,7 +768,7 @@ export function setFollowMe(enabled: boolean) { |
|
|
|
|
* muted: boolean |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
export function setStartReactionsMuted(muted: boolean, updateBackend: boolean = false) { |
|
|
|
|
export function setStartReactionsMuted(muted: boolean, updateBackend = false) { |
|
|
|
|
return { |
|
|
|
|
type: SET_START_REACTIONS_MUTED, |
|
|
|
|
muted, |
|
|
|
@ -791,10 +788,10 @@ export function setStartReactionsMuted(muted: boolean, updateBackend: boolean = |
|
|
|
|
* @returns {Function} |
|
|
|
|
*/ |
|
|
|
|
export function setPassword( |
|
|
|
|
conference: Object, |
|
|
|
|
conference: IJitsiConference, |
|
|
|
|
method: Function, |
|
|
|
|
password: string) { |
|
|
|
|
return (dispatch: Dispatch<any>, getState: Function): ?Promise<void> => { |
|
|
|
|
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => { |
|
|
|
|
switch (method) { |
|
|
|
|
case conference.join: { |
|
|
|
|
let state = getState()['features/base/conference']; |
|
|
|
@ -832,7 +829,7 @@ export function setPassword( |
|
|
|
|
method, |
|
|
|
|
password |
|
|
|
|
})) |
|
|
|
|
.catch(error => dispatch({ |
|
|
|
|
.catch((error: Error) => dispatch({ |
|
|
|
|
type: SET_PASSWORD_FAILED, |
|
|
|
|
error |
|
|
|
|
})) |
|
|
|
@ -873,7 +870,7 @@ export function setObfuscatedRoom(obfuscatedRoom: string, obfuscatedRoomSource: |
|
|
|
|
* room: string |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
export function setRoom(room: ?string) { |
|
|
|
|
export function setRoom(room?: string) { |
|
|
|
|
return { |
|
|
|
|
type: SET_ROOM, |
|
|
|
|
room |
|
|
|
@ -891,10 +888,10 @@ export function setRoom(room: ?string) { |
|
|
|
|
*/ |
|
|
|
|
export function setStartMutedPolicy( |
|
|
|
|
startAudioMuted: boolean, startVideoMuted: boolean) { |
|
|
|
|
return (dispatch: Dispatch<any>, getState: Function) => { |
|
|
|
|
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => { |
|
|
|
|
const conference = getCurrentConference(getState()); |
|
|
|
|
|
|
|
|
|
conference && conference.setStartMutedPolicy({ |
|
|
|
|
conference?.setStartMutedPolicy({ |
|
|
|
|
audio: startAudioMuted, |
|
|
|
|
video: startVideoMuted |
|
|
|
|
}); |
|
|
|
@ -911,7 +908,7 @@ export function setStartMutedPolicy( |
|
|
|
|
* @returns {void} |
|
|
|
|
*/ |
|
|
|
|
export function setSubject(subject: string) { |
|
|
|
|
return (dispatch: Dispatch<any>, getState: Function) => { |
|
|
|
|
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => { |
|
|
|
|
const { conference } = getState()['features/base/conference']; |
|
|
|
|
|
|
|
|
|
if (conference) { |