2022-11-10 08:45:56 +00:00
|
|
|
import { IStore } from '../app/types';
|
|
|
|
import { getParticipantDisplayName } from '../base/participants/functions';
|
|
|
|
import { showNotification } from '../notifications/actions';
|
|
|
|
import { NOTIFICATION_TIMEOUT_TYPE, NOTIFICATION_TYPE } from '../notifications/constants';
|
2019-06-17 14:00:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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}
|
|
|
|
*/
|
2022-11-10 08:45:56 +00:00
|
|
|
export function notifyKickedOut(participant: any, _?: Function) {
|
|
|
|
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
|
|
|
|
if (!participant || participant?.isReplaced()) {
|
2021-06-11 08:58:45 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-06-17 14:00:09 +00:00
|
|
|
const args = {
|
|
|
|
participantDisplayName:
|
2019-11-20 13:23:58 +00:00
|
|
|
getParticipantDisplayName(getState, participant.getId())
|
2019-06-17 14:00:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dispatch(showNotification({
|
|
|
|
appearance: NOTIFICATION_TYPE.ERROR,
|
|
|
|
hideErrorSupportLink: true,
|
|
|
|
descriptionKey: 'dialog.kickMessage',
|
|
|
|
descriptionArguments: args,
|
|
|
|
titleKey: 'dialog.kickTitle',
|
|
|
|
titleArguments: args
|
2021-11-24 11:05:27 +00:00
|
|
|
}, NOTIFICATION_TIMEOUT_TYPE.STICKY));
|
2019-06-17 14:00:09 +00:00
|
|
|
};
|
|
|
|
}
|