diff --git a/bigbluebutton-html5/imports/api/voice-users/server/methods/muteToggle.js b/bigbluebutton-html5/imports/api/voice-users/server/methods/muteToggle.js index 69b1071bd44244cc5d4b1352895adf6883d789b3..fdc3c23f4d4a6df62b6e16e7ce6327bf3a23ddba 100644 --- a/bigbluebutton-html5/imports/api/voice-users/server/methods/muteToggle.js +++ b/bigbluebutton-html5/imports/api/voice-users/server/methods/muteToggle.js @@ -3,9 +3,8 @@ import { extractCredentials } from '/imports/api/common/server/helpers'; import RedisPubSub from '/imports/startup/server/redis'; import Users from '/imports/api/users'; import VoiceUsers from '/imports/api/voice-users'; -import _ from 'lodash'; -export default function muteToggle(uId, implicitMutedState) { +export default function muteToggle(uId) { const REDIS_CONFIG = Meteor.settings.private.redis; const CHANNEL = REDIS_CONFIG.channels.toAkkaApps; const EVENT_NAME = 'MuteUserCmdMsg'; @@ -31,7 +30,7 @@ export default function muteToggle(uId, implicitMutedState) { const payload = { userId: userToMute, mutedBy: requesterUserId, - mute: _.isNil(implicitMutedState) ? !muted : implicitMutedState, + mute: !muted, }; RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload); diff --git a/bigbluebutton-html5/imports/ui/services/audio-manager/index.js b/bigbluebutton-html5/imports/ui/services/audio-manager/index.js index 573adad6a5a014a4cd515e0b65f77a5918fe11e5..2a4aedf90fceb0ac8b1b90cf3b7cb1c0c35a9b39 100755 --- a/bigbluebutton-html5/imports/ui/services/audio-manager/index.js +++ b/bigbluebutton-html5/imports/ui/services/audio-manager/index.js @@ -8,7 +8,6 @@ import { notify } from '/imports/ui/services/notification'; import playAndRetry from '/imports/utils/mediaElementPlayRetry'; import iosWebviewAudioPolyfills from '/imports/utils/ios-webview-audio-polyfills'; import { tryGenerateIceCandidates } from '/imports/utils/safari-webrtc'; -import { makeCall } from '/imports/ui/services/api'; import AudioErrors from './error-codes'; const MEDIA = Meteor.settings.public.media; @@ -45,7 +44,6 @@ class AudioManager { outputDeviceId: null, muteHandle: null, autoplayBlocked: false, - wasMuted: false, }); this.useKurento = Meteor.settings.public.kurento.enableListenOnly; @@ -283,17 +281,13 @@ class AudioManager { this.isConnecting = false; this.isConnected = true; - if (this.wasMuted) { - makeCall('toggleVoice', true); - this.wasMuted = false; - } // listen to the VoiceUsers changes and update the flag if (!this.muteHandle) { const query = VoiceUsers.find({ intId: Auth.userID }, { fields: { muted: 1, talking: 1 } }); this.muteHandle = query.observeChanges({ changed: (id, fields) => { if (fields.muted !== undefined && fields.muted !== this.isMuted) { - this.isMuted = true; + this.isMuted = fields.muted; const muteState = this.isMuted ? 'selfMuted' : 'selfUnmuted'; window.parent.postMessage({ response: muteState }, '*'); } @@ -385,8 +379,6 @@ class AudioManager { this.onAudioExit(); } } else if (status === RECONNECTING) { - // I catch it here, because any place after reconnecting will clear this state - if (this.isMuted) this.wasMuted = true; logger.info({ logCode: 'audio_reconnecting' }, 'Attempting to reconnect audio'); this.notify(this.intl.formatMessage(this.messages.info.RECONNECTING_AUDIO), true); this.playHangUpSound();