diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/voice/commands/MicrophoneMuteCommand.as b/clients/flash/air-client/src/org/bigbluebutton/air/voice/commands/MicrophoneMuteCommand.as index 000f2e2e89..9e5013897c 100755 --- a/clients/flash/air-client/src/org/bigbluebutton/air/voice/commands/MicrophoneMuteCommand.as +++ b/clients/flash/air-client/src/org/bigbluebutton/air/voice/commands/MicrophoneMuteCommand.as @@ -18,13 +18,12 @@ package org.bigbluebutton.air.voice.commands { public var userId:String; override public function execute():void { - trace("MicrophoneMuteCommand.execute() - userId = " + userId); var vu:VoiceUser = meetingData.voiceUsers.getUser(userId); if (vu != null) { - if (vu.muted) { - voiceService.unmute(userId); - } else { + if (!vu.muted || meetingData.meetingStatus.lockSettings.disableMic) { voiceService.mute(userId); + } else { + voiceService.unmute(userId); } } } diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/voice/models/VoiceUsers.as b/clients/flash/air-client/src/org/bigbluebutton/air/voice/models/VoiceUsers.as index 41c1e64211..015b597260 100755 --- a/clients/flash/air-client/src/org/bigbluebutton/air/voice/models/VoiceUsers.as +++ b/clients/flash/air-client/src/org/bigbluebutton/air/voice/models/VoiceUsers.as @@ -39,7 +39,7 @@ package org.bigbluebutton.air.voice.models { if (index >= 0) { var removedUser:VoiceUser = _users.removeItemAt(index) as VoiceUser; - if (_me == removedUser) { + if (_me.intId == removedUser.intId) { _me = null; } @@ -77,6 +77,7 @@ package org.bigbluebutton.air.voice.models { // Force user to not talking if muted. user.talking = false; } + _userChangeSignal.dispatch(user, VoiceUserChangeEnum.MUTE); } } diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/voice/services/VoiceConnection.as b/clients/flash/air-client/src/org/bigbluebutton/air/voice/services/VoiceConnection.as index 24feb44349..b6f4d5dae3 100755 --- a/clients/flash/air-client/src/org/bigbluebutton/air/voice/services/VoiceConnection.as +++ b/clients/flash/air-client/src/org/bigbluebutton/air/voice/services/VoiceConnection.as @@ -13,7 +13,9 @@ package org.bigbluebutton.air.voice.services { import org.bigbluebutton.air.main.models.IUserSession; import org.bigbluebutton.air.main.models.LockSettings2x; import org.bigbluebutton.air.user.models.UserRole; + import org.bigbluebutton.air.voice.commands.MicrophoneMuteSignal; import org.bigbluebutton.air.voice.commands.ShareMicrophoneSignal; + import org.bigbluebutton.air.voice.models.VoiceUser; import org.osflash.signals.ISignal; import org.osflash.signals.Signal; @@ -30,9 +32,9 @@ package org.bigbluebutton.air.voice.services { public var meetingData:IMeetingData; [Inject] - public var shareMicrophoneSignal:ShareMicrophoneSignal; + public var microphoneMuteSignal:MicrophoneMuteSignal; - public var _callActive:Boolean = false; + private var _callActive:Boolean = false; protected var _connectionSuccessSignal:ISignal = new Signal(); @@ -61,8 +63,12 @@ package org.bigbluebutton.air.voice.services { private function lockSettingsChange(lockSettings:LockSettings2x):void { if (lockSettings.disableMic && meetingData.users.me.locked && meetingData.users.me.role != UserRole.MODERATOR) { - trace("TODO: Disabling the mic still needs to be finished"); - //shareMicrophoneSignal.dispatch(audioOptions); + if (meetingData.voiceUsers.me != null) { + var vu:VoiceUser = meetingData.voiceUsers.getUser(meetingData.users.me.intId); + if (!vu.muted && meetingData.meetingStatus.lockSettings.disableMic) { + microphoneMuteSignal.dispatch(meetingData.users.me.intId); + } + } } } diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/voice/services/VoiceMessageReceiver.as b/clients/flash/air-client/src/org/bigbluebutton/air/voice/services/VoiceMessageReceiver.as index 44ac4bdb2a..1b442ecc7c 100755 --- a/clients/flash/air-client/src/org/bigbluebutton/air/voice/services/VoiceMessageReceiver.as +++ b/clients/flash/air-client/src/org/bigbluebutton/air/voice/services/VoiceMessageReceiver.as @@ -68,12 +68,11 @@ package org.bigbluebutton.air.voice.services { meetingData.voiceUsers.remove(intId); } - private function handleUserMutedEvtMsg(msg:Object):void { + private function handleUserMutedEvtMsg(msg:Object):void { var header:Object = msg.header as Object; var body:Object = msg.body as Object; var intId:String = body.intId as String; var muted:Boolean = body.muted as Boolean; - meetingData.voiceUsers.changeUserMute(intId, muted); }