feat(mobile): handle kicked out of the conference
Being kicked out of the conference will result with a conference failed event with 'conference.kicked' reason and take the user back to the welcome page by navigating to 'undefined'.
This commit is contained in:
parent
7c08116dc2
commit
6f11bbc400
|
@ -62,6 +62,17 @@ export const CONFERENCE_WILL_LEAVE = Symbol('CONFERENCE_WILL_LEAVE');
|
||||||
*/
|
*/
|
||||||
export const DATA_CHANNEL_OPENED = Symbol('DATA_CHANNEL_OPENED');
|
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
|
* The type of (redux) action which signals that the lock state of a specific
|
||||||
* {@code JitsiConference} changed.
|
* {@code JitsiConference} changed.
|
||||||
|
|
|
@ -28,6 +28,7 @@ import {
|
||||||
CONFERENCE_WILL_JOIN,
|
CONFERENCE_WILL_JOIN,
|
||||||
CONFERENCE_WILL_LEAVE,
|
CONFERENCE_WILL_LEAVE,
|
||||||
DATA_CHANNEL_OPENED,
|
DATA_CHANNEL_OPENED,
|
||||||
|
KICKED_OUT,
|
||||||
LOCK_STATE_CHANGED,
|
LOCK_STATE_CHANGED,
|
||||||
P2P_STATUS_CHANGED,
|
P2P_STATUS_CHANGED,
|
||||||
SET_AUDIO_ONLY,
|
SET_AUDIO_ONLY,
|
||||||
|
@ -78,6 +79,10 @@ function _addConferenceListeners(conference, dispatch) {
|
||||||
JitsiConferenceEvents.CONFERENCE_LEFT,
|
JitsiConferenceEvents.CONFERENCE_LEFT,
|
||||||
(...args) => dispatch(conferenceLeft(conference, ...args)));
|
(...args) => dispatch(conferenceLeft(conference, ...args)));
|
||||||
|
|
||||||
|
conference.on(
|
||||||
|
JitsiConferenceEvents.KICKED,
|
||||||
|
() => dispatch(kickedOut(conference)));
|
||||||
|
|
||||||
conference.on(
|
conference.on(
|
||||||
JitsiConferenceEvents.LOCK_STATE_CHANGED,
|
JitsiConferenceEvents.LOCK_STATE_CHANGED,
|
||||||
(...args) => dispatch(lockStateChanged(conference, ...args)));
|
(...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.
|
* Signals that the lock state of a specific JitsiConference changed.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
|
import { appNavigate } from '../app';
|
||||||
import {
|
import {
|
||||||
CONFERENCE_JOINED,
|
CONFERENCE_JOINED,
|
||||||
|
KICKED_OUT,
|
||||||
VIDEO_QUALITY_LEVELS,
|
VIDEO_QUALITY_LEVELS,
|
||||||
|
conferenceFailed,
|
||||||
setReceiveVideoQuality
|
setReceiveVideoQuality
|
||||||
} from '../base/conference';
|
} from '../base/conference';
|
||||||
|
import { JitsiConferenceEvents } from '../base/lib-jitsi-meet';
|
||||||
import { SET_REDUCED_UI } from '../base/responsive-ui';
|
import { SET_REDUCED_UI } from '../base/responsive-ui';
|
||||||
import { MiddlewareRegistry } from '../base/redux';
|
import { MiddlewareRegistry } from '../base/redux';
|
||||||
import { setFilmstripEnabled } from '../filmstrip';
|
import { setFilmstripEnabled } from '../filmstrip';
|
||||||
|
@ -35,6 +39,15 @@ MiddlewareRegistry.register(store => next => action => {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case KICKED_OUT: {
|
||||||
|
const { dispatch } = store;
|
||||||
|
|
||||||
|
dispatch(
|
||||||
|
conferenceFailed(action.conference, JitsiConferenceEvents.KICKED));
|
||||||
|
dispatch(appNavigate(undefined));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue