Skip to content
Snippets Groups Projects
Commit 8e9605bc authored by Anton Georgiev's avatar Anton Georgiev Committed by GitHub
Browse files

Merge pull request #3802 from antobinary/fix-listenonly

[HTML5] Fix event name causing issues with listenOnly status
parents a8349183 11871d7d
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@ function exitAudio(afterExitCall = () => {}) {
// notify BBB-apps we are leaving the call call if we are listen only
if (amIListenOnly()) {
callServer('listenOnlyRequestToggle', false);
callServer('listenOnlyToggle', false);
}
window.webrtc_hangup(hangupCallback);
......@@ -132,7 +132,7 @@ function joinVoiceCallSIP(options) {
}
function joinListenOnly() {
callServer('listenOnlyRequestToggle', true);
callServer('listenOnlyToggle', true);
if (MEDIA_CONFIG.useSIPAudio) {
joinVoiceCallSIP({ isListenOnly: true });
} else {
......
......@@ -16,13 +16,15 @@ export default function listenOnlyToggle(credentials, isJoining = true) {
check(requesterUserId, String);
check(isJoining, Boolean);
let EVENT_NAME = undefined;
if (isJoining) {
let EVENT_NAME = 'user_connected_to_global_audio';
EVENT_NAME = 'user_connected_to_global_audio';
if (!isAllowedTo('joinListenOnly', credentials)) {
throw new Meteor.Error('not-allowed', `You are not allowed to joinListenOnly`);
}
} else {
let EVENT_NAME = 'user_disconnected_from_global_audio';
EVENT_NAME = 'user_disconnected_from_global_audio';
if (!isAllowedTo('leaveListenOnly', credentials)) {
throw new Meteor.Error('not-allowed', `You are not allowed to leaveListenOnly`);
}
......@@ -40,6 +42,7 @@ export default function listenOnlyToggle(credentials, isJoining = true) {
meetingId,
userId: requesterUserId,
});
if (!User) {
throw new Meteor.Error(
'user-not-found', `You need a valid user to be able to toggle audio`);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment