MODERATE_FILES role can clean all files in a room, fixes #209
parent
7340621b6e
commit
e28b6cdc5d
|
|
@ -1317,6 +1317,28 @@ export default class RoomClient
|
||||||
roomActions.setClearChatInProgress(false));
|
roomActions.setClearChatInProgress(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async clearFileSharing()
|
||||||
|
{
|
||||||
|
logger.debug('clearFileSharing()');
|
||||||
|
|
||||||
|
store.dispatch(
|
||||||
|
roomActions.setClearFileSharingInProgress(true));
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await this.sendRequest('moderator:clearFileSharing');
|
||||||
|
|
||||||
|
store.dispatch(fileActions.clearFiles());
|
||||||
|
}
|
||||||
|
catch (error)
|
||||||
|
{
|
||||||
|
logger.error('clearFileSharing() failed: %o', error);
|
||||||
|
}
|
||||||
|
|
||||||
|
store.dispatch(
|
||||||
|
roomActions.setClearFileSharingInProgress(false));
|
||||||
|
}
|
||||||
|
|
||||||
async kickPeer(peerId)
|
async kickPeer(peerId)
|
||||||
{
|
{
|
||||||
logger.debug('kickPeer() [peerId:"%s"]', peerId);
|
logger.debug('kickPeer() [peerId:"%s"]', peerId);
|
||||||
|
|
@ -2217,6 +2239,21 @@ export default class RoomClient
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'moderator:clearFileSharing':
|
||||||
|
{
|
||||||
|
store.dispatch(fileActions.clearFiles());
|
||||||
|
|
||||||
|
store.dispatch(requestActions.notify(
|
||||||
|
{
|
||||||
|
text : intl.formatMessage({
|
||||||
|
id : 'moderator.clearFiles',
|
||||||
|
defaultMessage : 'Moderator cleared the files'
|
||||||
|
})
|
||||||
|
}));
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case 'producerScore':
|
case 'producerScore':
|
||||||
{
|
{
|
||||||
const { producerId, score } = notification.data;
|
const { producerId, score } = notification.data;
|
||||||
|
|
|
||||||
|
|
@ -33,3 +33,8 @@ export const setFileDone = (magnetUri, sharedFiles) =>
|
||||||
type : 'SET_FILE_DONE',
|
type : 'SET_FILE_DONE',
|
||||||
payload : { magnetUri, sharedFiles }
|
payload : { magnetUri, sharedFiles }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const clearFiles = () =>
|
||||||
|
({
|
||||||
|
type : 'CLEAR_FILES'
|
||||||
|
});
|
||||||
|
|
@ -135,6 +135,12 @@ export const setClearChatInProgress = (flag) =>
|
||||||
payload : { flag }
|
payload : { flag }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const setClearFileSharingInProgress = (flag) =>
|
||||||
|
({
|
||||||
|
type : 'CLEAR_FILE_SHARING_IN_PROGRESS',
|
||||||
|
payload : { flag }
|
||||||
|
});
|
||||||
|
|
||||||
export const setUserRoles = (userRoles) =>
|
export const setUserRoles = (userRoles) =>
|
||||||
({
|
({
|
||||||
type : 'SET_USER_ROLES',
|
type : 'SET_USER_ROLES',
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import { withStyles } from '@material-ui/core/styles';
|
||||||
import { withRoomContext } from '../../../RoomContext';
|
import { withRoomContext } from '../../../RoomContext';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
import FileList from './FileList';
|
import FileList from './FileList';
|
||||||
|
import FileSharingModerator from './FileSharingModerator';
|
||||||
import Paper from '@material-ui/core/Paper';
|
import Paper from '@material-ui/core/Paper';
|
||||||
import Button from '@material-ui/core/Button';
|
import Button from '@material-ui/core/Button';
|
||||||
|
|
||||||
|
|
@ -58,6 +59,7 @@ const FileSharing = (props) =>
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Paper className={classes.root}>
|
<Paper className={classes.root}>
|
||||||
|
<FileSharingModerator />
|
||||||
<input
|
<input
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
type='file'
|
type='file'
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,104 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { withRoomContext } from '../../../RoomContext';
|
||||||
|
import { withStyles } from '@material-ui/core/styles';
|
||||||
|
import { useIntl, FormattedMessage } from 'react-intl';
|
||||||
|
import Button from '@material-ui/core/Button';
|
||||||
|
|
||||||
|
const styles = (theme) =>
|
||||||
|
({
|
||||||
|
root :
|
||||||
|
{
|
||||||
|
padding : theme.spacing(1),
|
||||||
|
width : '100%',
|
||||||
|
overflow : 'hidden',
|
||||||
|
cursor : 'auto',
|
||||||
|
display : 'flex',
|
||||||
|
listStyleType : 'none',
|
||||||
|
boxShadow : '0 2px 5px 2px rgba(0, 0, 0, 0.2)',
|
||||||
|
backgroundColor : 'rgba(255, 255, 255, 1)'
|
||||||
|
},
|
||||||
|
listheader :
|
||||||
|
{
|
||||||
|
padding : theme.spacing(1),
|
||||||
|
fontWeight : 'bolder'
|
||||||
|
},
|
||||||
|
actionButton :
|
||||||
|
{
|
||||||
|
marginLeft : 'auto'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const FileSharingModerator = (props) =>
|
||||||
|
{
|
||||||
|
const intl = useIntl();
|
||||||
|
|
||||||
|
const {
|
||||||
|
roomClient,
|
||||||
|
isFileSharingModerator,
|
||||||
|
room,
|
||||||
|
classes
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
if (!isFileSharingModerator)
|
||||||
|
return;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ul className={classes.root}>
|
||||||
|
<li className={classes.listheader}>
|
||||||
|
<FormattedMessage
|
||||||
|
id='room.moderatoractions'
|
||||||
|
defaultMessage='Moderator actions'
|
||||||
|
/>
|
||||||
|
</li>
|
||||||
|
<Button
|
||||||
|
aria-label={intl.formatMessage({
|
||||||
|
id : 'room.clearFileSharing',
|
||||||
|
defaultMessage : 'Clear files'
|
||||||
|
})}
|
||||||
|
className={classes.actionButton}
|
||||||
|
variant='contained'
|
||||||
|
color='secondary'
|
||||||
|
disabled={room.clearFileSharingInProgress}
|
||||||
|
onClick={() => roomClient.clearFileSharing()}
|
||||||
|
>
|
||||||
|
<FormattedMessage
|
||||||
|
id='room.clearFileSharing'
|
||||||
|
defaultMessage='Clear files'
|
||||||
|
/>
|
||||||
|
</Button>
|
||||||
|
</ul>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
FileSharingModerator.propTypes =
|
||||||
|
{
|
||||||
|
roomClient : PropTypes.any.isRequired,
|
||||||
|
isFileSharingModerator : PropTypes.bool,
|
||||||
|
room : PropTypes.object,
|
||||||
|
classes : PropTypes.object.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapStateToProps = (state) =>
|
||||||
|
({
|
||||||
|
isFileSharingModerator :
|
||||||
|
state.me.roles.some((role) =>
|
||||||
|
state.room.permissionsFromRoles.MODERATE_FILES.includes(role)),
|
||||||
|
room : state.room
|
||||||
|
});
|
||||||
|
|
||||||
|
export default withRoomContext(connect(
|
||||||
|
mapStateToProps,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
{
|
||||||
|
areStatesEqual : (next, prev) =>
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
prev.room === next.room &&
|
||||||
|
prev.me === next.me
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)(withStyles(styles)(FileSharingModerator)));
|
||||||
|
|
@ -85,6 +85,9 @@ const files = (state = {}, action) =>
|
||||||
return { ...state, [magnetUri]: newFile };
|
return { ...state, [magnetUri]: newFile };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'CLEAR_FILES':
|
||||||
|
return {};
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,36 +1,38 @@
|
||||||
const initialState =
|
const initialState =
|
||||||
{
|
{
|
||||||
name : '',
|
name : '',
|
||||||
state : 'new', // new/connecting/connected/disconnected/closed,
|
state : 'new', // new/connecting/connected/disconnected/closed,
|
||||||
locked : false,
|
locked : false,
|
||||||
inLobby : false,
|
inLobby : false,
|
||||||
signInRequired : false,
|
signInRequired : false,
|
||||||
accessCode : '', // access code to the room if locked and joinByAccessCode == true
|
accessCode : '', // access code to the room if locked and joinByAccessCode == true
|
||||||
joinByAccessCode : true, // if true: accessCode is a possibility to open the room
|
joinByAccessCode : true, // if true: accessCode is a possibility to open the room
|
||||||
activeSpeakerId : null,
|
activeSpeakerId : null,
|
||||||
torrentSupport : false,
|
torrentSupport : false,
|
||||||
showSettings : false,
|
showSettings : false,
|
||||||
fullScreenConsumer : null, // ConsumerID
|
fullScreenConsumer : null, // ConsumerID
|
||||||
windowConsumer : null, // ConsumerID
|
windowConsumer : null, // ConsumerID
|
||||||
toolbarsVisible : true,
|
toolbarsVisible : true,
|
||||||
mode : 'democratic',
|
mode : 'democratic',
|
||||||
selectedPeerId : null,
|
selectedPeerId : null,
|
||||||
spotlights : [],
|
spotlights : [],
|
||||||
settingsOpen : false,
|
settingsOpen : false,
|
||||||
lockDialogOpen : false,
|
lockDialogOpen : false,
|
||||||
joined : false,
|
joined : false,
|
||||||
muteAllInProgress : false,
|
muteAllInProgress : false,
|
||||||
stopAllVideoInProgress : false,
|
stopAllVideoInProgress : false,
|
||||||
closeMeetingInProgress : false,
|
closeMeetingInProgress : false,
|
||||||
clearChatInProgress : false,
|
clearChatInProgress : false,
|
||||||
userRoles : { NORMAL: 'normal' }, // Default role
|
clearFileSharingInProgress : false,
|
||||||
permissionsFromRoles : {
|
userRoles : { NORMAL: 'normal' }, // Default role
|
||||||
|
permissionsFromRoles : {
|
||||||
CHANGE_ROOM_LOCK : [],
|
CHANGE_ROOM_LOCK : [],
|
||||||
PROMOTE_PEER : [],
|
PROMOTE_PEER : [],
|
||||||
SEND_CHAT : [],
|
SEND_CHAT : [],
|
||||||
MODERATE_CHAT : [],
|
MODERATE_CHAT : [],
|
||||||
SHARE_SCREEN : [],
|
SHARE_SCREEN : [],
|
||||||
SHARE_FILE : [],
|
SHARE_FILE : [],
|
||||||
|
MODERATE_FILES : [],
|
||||||
MODERATE_ROOM : []
|
MODERATE_ROOM : []
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -189,6 +191,9 @@ const room = (state = initialState, action) =>
|
||||||
case 'CLEAR_CHAT_IN_PROGRESS':
|
case 'CLEAR_CHAT_IN_PROGRESS':
|
||||||
return { ...state, clearChatInProgress: action.payload.flag };
|
return { ...state, clearChatInProgress: action.payload.flag };
|
||||||
|
|
||||||
|
case 'CLEAR_FILE_SHARING_IN_PROGRESS':
|
||||||
|
return { ...state, clearFileSharingInProgress: action.payload.flag };
|
||||||
|
|
||||||
case 'SET_USER_ROLES':
|
case 'SET_USER_ROLES':
|
||||||
{
|
{
|
||||||
const { userRoles } = action.payload;
|
const { userRoles } = action.payload;
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
"room.stopAllVideo": null,
|
"room.stopAllVideo": null,
|
||||||
"room.closeMeeting": null,
|
"room.closeMeeting": null,
|
||||||
"room.clearChat": null,
|
"room.clearChat": null,
|
||||||
|
"room.clearFileSharing": null,
|
||||||
"room.speechUnsupported": null,
|
"room.speechUnsupported": null,
|
||||||
|
|
||||||
"me.mutedPTT": null,
|
"me.mutedPTT": null,
|
||||||
|
|
@ -147,6 +148,7 @@
|
||||||
"devices.cameraError": "访问相机时发生错误",
|
"devices.cameraError": "访问相机时发生错误",
|
||||||
|
|
||||||
"moderator.clearChat": null,
|
"moderator.clearChat": null,
|
||||||
|
"moderator.clearFiles": null,
|
||||||
"moderator.muteAudio": null,
|
"moderator.muteAudio": null,
|
||||||
"moderator.muteVideo": null
|
"moderator.muteVideo": null
|
||||||
}
|
}
|
||||||
|
|
@ -52,6 +52,7 @@
|
||||||
"room.stopAllVideo": null,
|
"room.stopAllVideo": null,
|
||||||
"room.closeMeeting": null,
|
"room.closeMeeting": null,
|
||||||
"room.clearChat": null,
|
"room.clearChat": null,
|
||||||
|
"room.clearFileSharing": null,
|
||||||
"room.speechUnsupported": null,
|
"room.speechUnsupported": null,
|
||||||
|
|
||||||
"me.mutedPTT": null,
|
"me.mutedPTT": null,
|
||||||
|
|
@ -142,6 +143,7 @@
|
||||||
"devices.cameraError": "Při přístupu k vaší kameře se vyskytla chyba",
|
"devices.cameraError": "Při přístupu k vaší kameře se vyskytla chyba",
|
||||||
|
|
||||||
"moderator.clearChat": null,
|
"moderator.clearChat": null,
|
||||||
|
"moderator.clearFiles": null,
|
||||||
"moderator.muteAudio": null,
|
"moderator.muteAudio": null,
|
||||||
"moderator.muteVideo": null
|
"moderator.muteVideo": null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
"room.stopAllVideo": "Alle Videos stoppen",
|
"room.stopAllVideo": "Alle Videos stoppen",
|
||||||
"room.closeMeeting": "Meeting schließen",
|
"room.closeMeeting": "Meeting schließen",
|
||||||
"room.clearChat": null,
|
"room.clearChat": null,
|
||||||
|
"room.clearFileSharing": null,
|
||||||
"room.speechUnsupported": "Dein Browser unterstützt keine Spracherkennung",
|
"room.speechUnsupported": "Dein Browser unterstützt keine Spracherkennung",
|
||||||
|
|
||||||
"me.mutedPTT": "Du bist stummgeschalted, Halte die SPACE-Taste um zu sprechen",
|
"me.mutedPTT": "Du bist stummgeschalted, Halte die SPACE-Taste um zu sprechen",
|
||||||
|
|
@ -147,6 +148,7 @@
|
||||||
"devices.cameraError": "Fehler mit deiner Kamera",
|
"devices.cameraError": "Fehler mit deiner Kamera",
|
||||||
|
|
||||||
"moderator.clearChat": null,
|
"moderator.clearChat": null,
|
||||||
|
"moderator.clearFiles": null,
|
||||||
"moderator.muteAudio": null,
|
"moderator.muteAudio": null,
|
||||||
"moderator.muteVideo": null
|
"moderator.muteVideo": null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
"room.stopAllVideo": null,
|
"room.stopAllVideo": null,
|
||||||
"room.closeMeeting": null,
|
"room.closeMeeting": null,
|
||||||
"room.clearChat": null,
|
"room.clearChat": null,
|
||||||
|
"room.clearFileSharing": null,
|
||||||
"room.speechUnsupported": null,
|
"room.speechUnsupported": null,
|
||||||
|
|
||||||
"me.mutedPTT": null,
|
"me.mutedPTT": null,
|
||||||
|
|
@ -147,6 +148,7 @@
|
||||||
"device.cameraError": "Der opstod en fejl ved tilkobling af dit kamera",
|
"device.cameraError": "Der opstod en fejl ved tilkobling af dit kamera",
|
||||||
|
|
||||||
"moderator.clearChat": null,
|
"moderator.clearChat": null,
|
||||||
|
"moderator.clearFiles": null,
|
||||||
"moderator.muteAudio": null,
|
"moderator.muteAudio": null,
|
||||||
"moderator.muteVideo": null
|
"moderator.muteVideo": null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
"room.stopAllVideo": null,
|
"room.stopAllVideo": null,
|
||||||
"room.closeMeeting": null,
|
"room.closeMeeting": null,
|
||||||
"room.clearChat": null,
|
"room.clearChat": null,
|
||||||
|
"room.clearFileSharing": null,
|
||||||
"room.speechUnsupported": null,
|
"room.speechUnsupported": null,
|
||||||
|
|
||||||
"me.mutedPTT": null,
|
"me.mutedPTT": null,
|
||||||
|
|
@ -147,6 +148,7 @@
|
||||||
"devices.cameraError": "Παρουσιάστηκε σφάλμα κατά την πρόσβαση στην κάμερά σας",
|
"devices.cameraError": "Παρουσιάστηκε σφάλμα κατά την πρόσβαση στην κάμερά σας",
|
||||||
|
|
||||||
"moderator.clearChat": null,
|
"moderator.clearChat": null,
|
||||||
|
"moderator.clearFiles": null,
|
||||||
"moderator.muteAudio": null,
|
"moderator.muteAudio": null,
|
||||||
"moderator.muteVideo": null
|
"moderator.muteVideo": null
|
||||||
}
|
}
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
"room.stopAllVideo": "Stop all video",
|
"room.stopAllVideo": "Stop all video",
|
||||||
"room.closeMeeting": "Close meeting",
|
"room.closeMeeting": "Close meeting",
|
||||||
"room.clearChat": "Clear chat",
|
"room.clearChat": "Clear chat",
|
||||||
|
"room.clearFileSharing": "Clear files",
|
||||||
"room.speechUnsupported": "Your browser does not support speech recognition",
|
"room.speechUnsupported": "Your browser does not support speech recognition",
|
||||||
|
|
||||||
"me.mutedPTT": "You are muted, hold down SPACE-BAR to talk",
|
"me.mutedPTT": "You are muted, hold down SPACE-BAR to talk",
|
||||||
|
|
@ -147,6 +148,7 @@
|
||||||
"devices.cameraError": "An error occured while accessing your camera",
|
"devices.cameraError": "An error occured while accessing your camera",
|
||||||
|
|
||||||
"moderator.clearChat": "Moderator cleared the chat",
|
"moderator.clearChat": "Moderator cleared the chat",
|
||||||
|
"moderator.clearFiles": "Moderator cleared the files",
|
||||||
"moderator.muteAudio": "Moderator muted your audio",
|
"moderator.muteAudio": "Moderator muted your audio",
|
||||||
"moderator.muteVideo": "Moderator muted your video"
|
"moderator.muteVideo": "Moderator muted your video"
|
||||||
}
|
}
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
"room.stopAllVideo": null,
|
"room.stopAllVideo": null,
|
||||||
"room.closeMeeting": null,
|
"room.closeMeeting": null,
|
||||||
"room.clearChat": null,
|
"room.clearChat": null,
|
||||||
|
"room.clearFileSharing": null,
|
||||||
"room.speechUnsupported": null,
|
"room.speechUnsupported": null,
|
||||||
|
|
||||||
"me.mutedPTT": null,
|
"me.mutedPTT": null,
|
||||||
|
|
@ -147,6 +148,7 @@
|
||||||
"devices.cameraError": "Hubo un error al acceder a su cámara",
|
"devices.cameraError": "Hubo un error al acceder a su cámara",
|
||||||
|
|
||||||
"moderator.clearChat": null,
|
"moderator.clearChat": null,
|
||||||
|
"moderator.clearFiles": null,
|
||||||
"moderator.muteAudio": null,
|
"moderator.muteAudio": null,
|
||||||
"moderator.muteVideo": null
|
"moderator.muteVideo": null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
"room.stopAllVideo": null,
|
"room.stopAllVideo": null,
|
||||||
"room.closeMeeting": null,
|
"room.closeMeeting": null,
|
||||||
"room.clearChat": null,
|
"room.clearChat": null,
|
||||||
|
"room.clearFileSharing": null,
|
||||||
"room.speechUnsupported": null,
|
"room.speechUnsupported": null,
|
||||||
|
|
||||||
"me.mutedPTT": null,
|
"me.mutedPTT": null,
|
||||||
|
|
@ -146,6 +147,7 @@
|
||||||
"devices.cameraError": "Une erreur est apparue lors de l'accès à votre caméra",
|
"devices.cameraError": "Une erreur est apparue lors de l'accès à votre caméra",
|
||||||
|
|
||||||
"moderator.clearChat": null,
|
"moderator.clearChat": null,
|
||||||
|
"moderator.clearFiles": null,
|
||||||
"moderator.muteAudio": null,
|
"moderator.muteAudio": null,
|
||||||
"moderator.muteVideo": null
|
"moderator.muteVideo": null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
"room.stopAllVideo": "Ugasi sve kamere",
|
"room.stopAllVideo": "Ugasi sve kamere",
|
||||||
"room.closeMeeting": "Završi sastanak",
|
"room.closeMeeting": "Završi sastanak",
|
||||||
"room.clearChat": null,
|
"room.clearChat": null,
|
||||||
|
"room.clearFileSharing": null,
|
||||||
"room.speechUnsupported": "Vaš preglednik ne podržava prepoznavanje govora",
|
"room.speechUnsupported": "Vaš preglednik ne podržava prepoznavanje govora",
|
||||||
|
|
||||||
"me.mutedPTT": "Utišani ste, pritisnite i držite SPACE tipku za razgovor",
|
"me.mutedPTT": "Utišani ste, pritisnite i držite SPACE tipku za razgovor",
|
||||||
|
|
@ -147,6 +148,7 @@
|
||||||
"devices.cameraError": "Greška prilikom pristupa kameri",
|
"devices.cameraError": "Greška prilikom pristupa kameri",
|
||||||
|
|
||||||
"moderator.clearChat": null,
|
"moderator.clearChat": null,
|
||||||
|
"moderator.clearFiles": null,
|
||||||
"moderator.muteAudio": null,
|
"moderator.muteAudio": null,
|
||||||
"moderator.muteVideo": null
|
"moderator.muteVideo": null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
"room.stopAllVideo": null,
|
"room.stopAllVideo": null,
|
||||||
"room.closeMeeting": null,
|
"room.closeMeeting": null,
|
||||||
"room.clearChat": null,
|
"room.clearChat": null,
|
||||||
|
"room.clearFileSharing": null,
|
||||||
"room.speechUnsupported": null,
|
"room.speechUnsupported": null,
|
||||||
|
|
||||||
"me.mutedPTT": null,
|
"me.mutedPTT": null,
|
||||||
|
|
@ -147,6 +148,7 @@
|
||||||
"devices.cameraError": "Hiba történt a kamera elérése során",
|
"devices.cameraError": "Hiba történt a kamera elérése során",
|
||||||
|
|
||||||
"moderator.clearChat": null,
|
"moderator.clearChat": null,
|
||||||
|
"moderator.clearFiles": null,
|
||||||
"moderator.muteAudio": null,
|
"moderator.muteAudio": null,
|
||||||
"moderator.muteVideo": null
|
"moderator.muteVideo": null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
"room.stopAllVideo": null,
|
"room.stopAllVideo": null,
|
||||||
"room.closeMeeting": null,
|
"room.closeMeeting": null,
|
||||||
"room.clearChat": null,
|
"room.clearChat": null,
|
||||||
|
"room.clearFileSharing": null,
|
||||||
"room.speechUnsupported": null,
|
"room.speechUnsupported": null,
|
||||||
|
|
||||||
"me.mutedPTT": null,
|
"me.mutedPTT": null,
|
||||||
|
|
@ -146,6 +147,7 @@
|
||||||
"devices.cameraError": "Errore con l'accesso alla videocamera",
|
"devices.cameraError": "Errore con l'accesso alla videocamera",
|
||||||
|
|
||||||
"moderator.clearChat": null,
|
"moderator.clearChat": null,
|
||||||
|
"moderator.clearFiles": null,
|
||||||
"moderator.muteAudio": null,
|
"moderator.muteAudio": null,
|
||||||
"moderator.muteVideo": null
|
"moderator.muteVideo": null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
"room.stopAllVideo": "Stopp all video",
|
"room.stopAllVideo": "Stopp all video",
|
||||||
"room.closeMeeting": "Avslutt møte",
|
"room.closeMeeting": "Avslutt møte",
|
||||||
"room.clearChat": "Tøm chat",
|
"room.clearChat": "Tøm chat",
|
||||||
|
"room.clearFileSharing": "Fjern filer",
|
||||||
"room.speechUnsupported": "Din nettleser støtter ikke stemmegjenkjenning",
|
"room.speechUnsupported": "Din nettleser støtter ikke stemmegjenkjenning",
|
||||||
|
|
||||||
"me.mutedPTT": "Du er dempet, hold nede SPACE for å snakke",
|
"me.mutedPTT": "Du er dempet, hold nede SPACE for å snakke",
|
||||||
|
|
@ -147,6 +148,7 @@
|
||||||
"devices.cameraError": "Det skjedde noe feil med kameraet ditt",
|
"devices.cameraError": "Det skjedde noe feil med kameraet ditt",
|
||||||
|
|
||||||
"moderator.clearChat": "Moderator tømte chatten",
|
"moderator.clearChat": "Moderator tømte chatten",
|
||||||
|
"moderator.clearFiles": "Moderator fjernet filer",
|
||||||
"moderator.muteAudio": "Moderator mutet lyden din",
|
"moderator.muteAudio": "Moderator mutet lyden din",
|
||||||
"moderator.muteVideo": "Moderator mutet videoen din"
|
"moderator.muteVideo": "Moderator mutet videoen din"
|
||||||
}
|
}
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
"room.stopAllVideo": null,
|
"room.stopAllVideo": null,
|
||||||
"room.closeMeeting": null,
|
"room.closeMeeting": null,
|
||||||
"room.clearChat": null,
|
"room.clearChat": null,
|
||||||
|
"room.clearFileSharing": null,
|
||||||
"room.speechUnsupported": null,
|
"room.speechUnsupported": null,
|
||||||
|
|
||||||
"me.mutedPTT": null,
|
"me.mutedPTT": null,
|
||||||
|
|
@ -147,6 +148,7 @@
|
||||||
"devices.cameraError": "Wystąpił błąd podczas uzyskiwania dostępu do kamery",
|
"devices.cameraError": "Wystąpił błąd podczas uzyskiwania dostępu do kamery",
|
||||||
|
|
||||||
"moderator.clearChat": null,
|
"moderator.clearChat": null,
|
||||||
|
"moderator.clearFiles": null,
|
||||||
"moderator.muteAudio": null,
|
"moderator.muteAudio": null,
|
||||||
"moderator.muteVideo": null
|
"moderator.muteVideo": null
|
||||||
}
|
}
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
"room.stopAllVideo": null,
|
"room.stopAllVideo": null,
|
||||||
"room.closeMeeting": null,
|
"room.closeMeeting": null,
|
||||||
"room.clearChat": null,
|
"room.clearChat": null,
|
||||||
|
"room.clearFileSharing": null,
|
||||||
"room.speechUnsupported": null,
|
"room.speechUnsupported": null,
|
||||||
|
|
||||||
"me.mutedPTT": null,
|
"me.mutedPTT": null,
|
||||||
|
|
@ -147,6 +148,7 @@
|
||||||
"devices.cameraError": "Ocorreu um erro no acesso à sua câmara",
|
"devices.cameraError": "Ocorreu um erro no acesso à sua câmara",
|
||||||
|
|
||||||
"moderator.clearChat": null,
|
"moderator.clearChat": null,
|
||||||
|
"moderator.clearFiles": null,
|
||||||
"moderator.muteAudio": null,
|
"moderator.muteAudio": null,
|
||||||
"moderator.muteVideo": null
|
"moderator.muteVideo": null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
"room.stopAllVideo": null,
|
"room.stopAllVideo": null,
|
||||||
"room.closeMeeting": null,
|
"room.closeMeeting": null,
|
||||||
"room.clearChat": null,
|
"room.clearChat": null,
|
||||||
|
"room.clearFileSharing": null,
|
||||||
"room.speechUnsupported": null,
|
"room.speechUnsupported": null,
|
||||||
|
|
||||||
"me.mutedPTT": null,
|
"me.mutedPTT": null,
|
||||||
|
|
@ -147,6 +148,7 @@
|
||||||
"devices.cameraError": "A apărut o eroare la accesarea camerei video",
|
"devices.cameraError": "A apărut o eroare la accesarea camerei video",
|
||||||
|
|
||||||
"moderator.clearChat": null,
|
"moderator.clearChat": null,
|
||||||
|
"moderator.clearFiles": null,
|
||||||
"moderator.muteAudio": null,
|
"moderator.muteAudio": null,
|
||||||
"moderator.muteVideo": null
|
"moderator.muteVideo": null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
"room.stopAllVideo": null,
|
"room.stopAllVideo": null,
|
||||||
"room.closeMeeting": null,
|
"room.closeMeeting": null,
|
||||||
"room.clearChat": null,
|
"room.clearChat": null,
|
||||||
|
"room.clearFileSharing": null,
|
||||||
"room.speechUnsupported": null,
|
"room.speechUnsupported": null,
|
||||||
|
|
||||||
"tooltip.login": "Увійти",
|
"tooltip.login": "Увійти",
|
||||||
|
|
@ -144,6 +145,7 @@
|
||||||
"devices.cameraError": "Під час доступу до камери сталася помилка",
|
"devices.cameraError": "Під час доступу до камери сталася помилка",
|
||||||
|
|
||||||
"moderator.clearChat": null,
|
"moderator.clearChat": null,
|
||||||
|
"moderator.clearFiles": null,
|
||||||
"moderator.muteAudio": null,
|
"moderator.muteAudio": null,
|
||||||
"moderator.muteVideo": null
|
"moderator.muteVideo": null
|
||||||
}
|
}
|
||||||
|
|
@ -235,6 +235,8 @@ module.exports =
|
||||||
SHARE_SCREEN : [ userRoles.NORMAL ],
|
SHARE_SCREEN : [ userRoles.NORMAL ],
|
||||||
// The role(s) have permission to share files
|
// The role(s) have permission to share files
|
||||||
SHARE_FILE : [ userRoles.NORMAL ],
|
SHARE_FILE : [ userRoles.NORMAL ],
|
||||||
|
// The role(s) have permission to moderate files
|
||||||
|
MODERATE_FILES : [ userRoles.MODERATOR ],
|
||||||
// The role(s) have permission to moderate room (e.g. kick user)
|
// The role(s) have permission to moderate room (e.g. kick user)
|
||||||
MODERATE_ROOM : [ userRoles.MODERATOR ]
|
MODERATE_ROOM : [ userRoles.MODERATOR ]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1178,6 +1178,24 @@ class Room extends EventEmitter
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'moderator:clearFileSharing':
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
!peer.roles.some((role) => config.permissionsFromRoles.MODERATE_FILES.includes(role))
|
||||||
|
)
|
||||||
|
throw new Error('peer not authorized');
|
||||||
|
|
||||||
|
this._fileHistory = [];
|
||||||
|
|
||||||
|
// Spread to others
|
||||||
|
this._notification(peer.socket, 'moderator:clearFileSharing', null, true);
|
||||||
|
|
||||||
|
// Return no error
|
||||||
|
cb();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case 'raiseHand':
|
case 'raiseHand':
|
||||||
{
|
{
|
||||||
const { raisedHand } = request.data;
|
const { raisedHand } = request.data;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue