mirror of https://github.com/jitsi/jitsi-meet
Notify for kick and mute (#4328)
* Updates kick showing who kicked us. * Notify participants that someone was kicked. * Shows notification to user who is remotely muted. * Updates the notification type. * Muted by notification for mobile. * Moves code to react and adds the kick notifications to mobile. * Updates lib-jitsi-meet.pull/4344/head jitsi-meet_3799
parent
fa88db6897
commit
6eb66b639e
@ -0,0 +1,31 @@ |
||||
// @flow
|
||||
|
||||
import type { Dispatch } from 'redux'; |
||||
|
||||
import { |
||||
AlertDialog, |
||||
openDialog |
||||
} from '../base/dialog'; |
||||
import { getParticipantDisplayName } from '../base/participants'; |
||||
|
||||
/** |
||||
* Notify that we've been kicked out of the conference. |
||||
* |
||||
* @param {JitsiParticipant} participant - The {@link JitsiParticipant} |
||||
* instance which initiated the kick event. |
||||
* @param {?Function} submit - The function to execute after submiting the dialog. |
||||
* @returns {Function} |
||||
*/ |
||||
export function notifyKickedOut(participant: Object, submit: ?Function) { |
||||
return (dispatch: Dispatch<any>, getState: Function) => { |
||||
dispatch(openDialog(AlertDialog, { |
||||
contentKey: { |
||||
key: 'dialog.kickTitle', |
||||
params: { |
||||
participantDisplayName: getParticipantDisplayName(getState, participant.getId()) |
||||
} |
||||
}, |
||||
onSubmit: submit |
||||
})); |
||||
}; |
||||
} |
@ -0,0 +1,35 @@ |
||||
// @flow
|
||||
|
||||
import type { Dispatch } from 'redux'; |
||||
|
||||
import { |
||||
NOTIFICATION_TYPE, |
||||
showNotification |
||||
} from '../notifications'; |
||||
import { getParticipantDisplayName } from '../base/participants'; |
||||
|
||||
/** |
||||
* 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) => { |
||||
const args = { |
||||
participantDisplayName: |
||||
getParticipantDisplayName(getState, participant.getDisplayName()) |
||||
}; |
||||
|
||||
dispatch(showNotification({ |
||||
appearance: NOTIFICATION_TYPE.ERROR, |
||||
hideErrorSupportLink: true, |
||||
descriptionKey: 'dialog.kickMessage', |
||||
descriptionArguments: args, |
||||
titleKey: 'dialog.kickTitle', |
||||
titleArguments: args |
||||
})); |
||||
}; |
||||
} |
@ -1,5 +1,5 @@ |
||||
// @flow
|
||||
|
||||
export * from './actions'; |
||||
export * from './components'; |
||||
|
||||
import './middleware'; |
||||
|
Loading…
Reference in new issue