2019-06-17 16:00:09 +02:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
|
|
import type { Dispatch } from 'redux';
|
|
|
|
|
|
2020-05-20 12:57:03 +02:00
|
|
|
import { getParticipantDisplayName } from '../base/participants';
|
2019-06-17 16:00:09 +02:00
|
|
|
import {
|
2021-11-24 13:05:27 +02:00
|
|
|
NOTIFICATION_TIMEOUT_TYPE,
|
2019-06-17 16:00:09 +02:00
|
|
|
NOTIFICATION_TYPE,
|
|
|
|
|
showNotification
|
|
|
|
|
} from '../notifications';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Notify that we've been kicked out of the conference.
|
|
|
|
|
*
|
|
|
|
|
* @param {JitsiParticipant} participant - The {@link JitsiParticipant}
|
|
|
|
|
* instance which initiated the kick event.
|
|
|
|
|
* @param {?Function} _ - Used only in native code.
|
|
|
|
|
* @returns {Function}
|
|
|
|
|
*/
|
|
|
|
|
export function notifyKickedOut(participant: Object, _: ?Function) { // eslint-disable-line no-unused-vars
|
|
|
|
|
return (dispatch: Dispatch<any>, getState: Function) => {
|
2021-06-11 11:58:45 +03:00
|
|
|
if (!participant || (participant.isReplaced && participant.isReplaced())) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-17 16:00:09 +02:00
|
|
|
const args = {
|
|
|
|
|
participantDisplayName:
|
2019-11-20 15:23:58 +02:00
|
|
|
getParticipantDisplayName(getState, participant.getId())
|
2019-06-17 16:00:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dispatch(showNotification({
|
|
|
|
|
appearance: NOTIFICATION_TYPE.ERROR,
|
|
|
|
|
hideErrorSupportLink: true,
|
|
|
|
|
descriptionKey: 'dialog.kickMessage',
|
|
|
|
|
descriptionArguments: args,
|
|
|
|
|
titleKey: 'dialog.kickTitle',
|
|
|
|
|
titleArguments: args
|
2021-11-24 13:05:27 +02:00
|
|
|
}, NOTIFICATION_TIMEOUT_TYPE.STICKY));
|
2019-06-17 16:00:09 +02:00
|
|
|
};
|
|
|
|
|
}
|