You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

actions.web.js 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // @flow
  2. import type { Dispatch } from 'redux';
  3. import { getParticipantDisplayName } from '../base/participants';
  4. import {
  5. NOTIFICATION_TYPE,
  6. showNotification
  7. } from '../notifications';
  8. /**
  9. * Notify that we've been kicked out of the conference.
  10. *
  11. * @param {JitsiParticipant} participant - The {@link JitsiParticipant}
  12. * instance which initiated the kick event.
  13. * @param {?Function} _ - Used only in native code.
  14. * @returns {Function}
  15. */
  16. export function notifyKickedOut(participant: Object, _: ?Function) { // eslint-disable-line no-unused-vars
  17. return (dispatch: Dispatch<any>, getState: Function) => {
  18. if (!participant || (participant.isReplaced && participant.isReplaced())) {
  19. return;
  20. }
  21. const args = {
  22. participantDisplayName:
  23. getParticipantDisplayName(getState, participant.getId())
  24. };
  25. dispatch(showNotification({
  26. appearance: NOTIFICATION_TYPE.ERROR,
  27. hideErrorSupportLink: true,
  28. descriptionKey: 'dialog.kickMessage',
  29. descriptionArguments: args,
  30. titleKey: 'dialog.kickTitle',
  31. titleArguments: args
  32. }));
  33. };
  34. }