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

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