Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
feat(mobile): handle kicked out of the conference
paweldomas6f11bbc40084
diff --git a/react/features/base/conference/actionTypes.js b/react/features/base/conference/actionTypes.jsindex 9aeaa8a320..e9a0d99999 100644--- a/react/features/base/conference/actionTypes.js+++ b/react/features/base/conference/actionTypes.js@@ -62,6 +62,17 @@ export const CONFERENCE_WILL_LEAVE = Symbol('CONFERENCE_WILL_LEAVE');*/export const DATA_CHANNEL_OPENED = Symbol('DATA_CHANNEL_OPENED');+/**+ * The type of action which signals that the user has been kicked out from+ * the conference.+ *+ * {+ * type: KICKED_OUT,+ * conference: JitsiConference+ * }+ */+export const KICKED_OUT = Symbol('KICKED_OUT');+/*** The type of (redux) action which signals that the lock state of a specific* {@code JitsiConference} changed.diff --git a/react/features/base/conference/actions.js b/react/features/base/conference/actions.jsindex 9f2f2b4550..c2b56573d4 100644--- a/react/features/base/conference/actions.js+++ b/react/features/base/conference/actions.js@@ -28,6 +28,7 @@ import {CONFERENCE_WILL_JOIN,CONFERENCE_WILL_LEAVE,DATA_CHANNEL_OPENED,+ KICKED_OUT,LOCK_STATE_CHANGED,P2P_STATUS_CHANGED,SET_AUDIO_ONLY,@@ -78,6 +79,10 @@ function _addConferenceListeners(conference, dispatch) {JitsiConferenceEvents.CONFERENCE_LEFT,(...args) => dispatch(conferenceLeft(conference, ...args)));+ conference.on(+ JitsiConferenceEvents.KICKED,+ () => dispatch(kickedOut(conference)));+conference.on(JitsiConferenceEvents.LOCK_STATE_CHANGED,(...args) => dispatch(lockStateChanged(conference, ...args)));@@ -358,6 +363,23 @@ export function dataChannelOpened() {};}+/**+ * Signals that we've been kicked out of the conference.+ *+ * @param {JitsiConference} conference - The {@link JitsiConference} instance+ * for which the event is being signaled.+ * @returns {{+ * type: KICKED_OUT,+ * conference: JitsiConference+ * }}+ */+export function kickedOut(conference: Object) {+ return {+ type: KICKED_OUT,+ conference+ };+}+/*** Signals that the lock state of a specific JitsiConference changed.*diff --git a/react/features/conference/middleware.js b/react/features/conference/middleware.jsindex f21e70fc09..54699f5066 100644--- a/react/features/conference/middleware.js+++ b/react/features/conference/middleware.js@@ -1,10 +1,14 @@// @flow+import { appNavigate } from '../app';import {CONFERENCE_JOINED,+ KICKED_OUT,VIDEO_QUALITY_LEVELS,+ conferenceFailed,setReceiveVideoQuality} from '../base/conference';+import { JitsiConferenceEvents } from '../base/lib-jitsi-meet';import { SET_REDUCED_UI } from '../base/responsive-ui';import { MiddlewareRegistry } from '../base/redux';import { setFilmstripEnabled } from '../filmstrip';@@ -35,6 +39,15 @@ MiddlewareRegistry.register(store => next => action => {break;}++ case KICKED_OUT: {+ const { dispatch } = store;++ dispatch(+ conferenceFailed(action.conference, JitsiConferenceEvents.KICKED));+ dispatch(appNavigate(undefined));+ break;+ }}return result;