Record options added to menu.
This commit is contained in:
+12
-2
@@ -1657,6 +1657,11 @@ function canModerateChat() {
|
||||
serverConnection.permissions.indexOf('op') >= 0);
|
||||
}
|
||||
|
||||
function canRecordHall() {
|
||||
return !!(serverConnection && serverConnection.permissions &&
|
||||
serverConnection.permissions.indexOf('record') >= 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {{label?: string, type?: string, onClick?: function(): void}[]} items
|
||||
* @param {HTMLElement} trigger
|
||||
@@ -1779,6 +1784,12 @@ function userMenu(elt) {
|
||||
inviteMenu();
|
||||
}});
|
||||
}
|
||||
if(canRecordHall()) {
|
||||
items.push({label: hallRecording ? 'Stop recording' : 'Start recording',
|
||||
onClick: () => {
|
||||
serverConnection.hallAction(hallRecording ? 'unrecord' : 'record');
|
||||
}});
|
||||
}
|
||||
if(findUpMedia('audio'))
|
||||
items.push({label: 'Turn microphone off', onClick: () => {
|
||||
closeUpMedia('audio');
|
||||
@@ -3131,8 +3142,7 @@ function chalkboardGrantPredicate() {
|
||||
}
|
||||
|
||||
function recordingPredicate() {
|
||||
if(serverConnection && serverConnection.permissions &&
|
||||
serverConnection.permissions.indexOf('record') >= 0)
|
||||
if(canRecordHall())
|
||||
return null;
|
||||
return 'You are not allowed to record';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user