jiti-meet/react/features/conference/actions.web.js

41 lines
1.2 KiB
JavaScript
Raw Normal View History

// @flow
import type { Dispatch } from 'redux';
2020-05-20 10:57:03 +00:00
import { getParticipantDisplayName } from '../base/participants';
import {
NOTIFICATION_TIMEOUT_TYPE,
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) => {
if (!participant || (participant.isReplaced && participant.isReplaced())) {
return;
}
const args = {
participantDisplayName:
2019-11-20 13:23:58 +00:00
getParticipantDisplayName(getState, participant.getId())
};
dispatch(showNotification({
appearance: NOTIFICATION_TYPE.ERROR,
hideErrorSupportLink: true,
descriptionKey: 'dialog.kickMessage',
descriptionArguments: args,
titleKey: 'dialog.kickTitle',
titleArguments: args
}, NOTIFICATION_TIMEOUT_TYPE.STICKY));
};
}