- pass mute param on message so we don't rely on toggling mute/unmute state for users

This commit is contained in:
Richard Alam 2017-11-17 08:46:18 -08:00
parent d4c20b239d
commit 6ff5d0db42
5 changed files with 42 additions and 37 deletions

View File

@ -16,10 +16,12 @@ trait MuteUserCmdMsgHdlr {
for {
u <- VoiceUsers.findWithIntId(liveMeeting.voiceUsers, msg.body.userId)
} yield {
log.info("Send mute user request. meetingId=" + props.meetingProp.intId + " userId=" + u.intId + " user=" + u)
val event = MsgBuilder.buildMuteUserInVoiceConfSysMsg(props.meetingProp.intId, props.voiceProp.voiceConf,
u.voiceUserId, !u.muted)
outGW.send(event)
if (u.muted != msg.body.mute) {
log.info("Send mute user request. meetingId=" + props.meetingProp.intId + " userId=" + u.intId + " user=" + u)
val event = MsgBuilder.buildMuteUserInVoiceConfSysMsg(props.meetingProp.intId, props.voiceProp.voiceConf,
u.voiceUserId, msg.body.mute)
outGW.send(event)
}
}
}
}

View File

@ -11,28 +11,29 @@ trait MuteAllExceptPresentersCmdMsgHdlr {
val outGW: OutMsgRouter
def handleMuteAllExceptPresentersCmdMsg(msg: MuteAllExceptPresentersCmdMsg) {
if (MeetingStatus2x.isMeetingMuted(liveMeeting.status)) {
MeetingStatus2x.unmuteMeeting(liveMeeting.status)
} else {
MeetingStatus2x.muteMeeting(liveMeeting.status)
}
if (msg.body.mute != MeetingStatus2x.isMeetingMuted(liveMeeting.status)) {
if (msg.body.mute) {
MeetingStatus2x.muteMeeting(liveMeeting.status)
} else {
MeetingStatus2x.unmuteMeeting(liveMeeting.status)
}
val muted = MeetingStatus2x.isMeetingMuted(liveMeeting.status)
val event = build(props.meetingProp.intId, msg.body.mutedBy, muted, msg.body.mutedBy)
val muted = MeetingStatus2x.isMeetingMuted(liveMeeting.status)
val event = build(props.meetingProp.intId, msg.body.mutedBy, muted, msg.body.mutedBy)
outGW.send(event)
outGW.send(event)
// I think the correct flow would be to find those who are presenters and exclude them
// from the list of voice users. The remaining, mute.
VoiceUsers.findAll(liveMeeting.voiceUsers) foreach { vu =>
if (!vu.listenOnly) {
Users2x.findWithIntId(liveMeeting.users2x, vu.intId) match {
case Some(u) => if (!u.presenter) muteUserInVoiceConf(vu, muted)
case None => muteUserInVoiceConf(vu, muted)
// I think the correct flow would be to find those who are presenters and exclude them
// from the list of voice users. The remaining, mute.
VoiceUsers.findAll(liveMeeting.voiceUsers) foreach { vu =>
if (!vu.listenOnly) {
Users2x.findWithIntId(liveMeeting.users2x, vu.intId) match {
case Some(u) => if (!u.presenter) muteUserInVoiceConf(vu, muted)
case None => muteUserInVoiceConf(vu, muted)
}
}
}
}
}
def usersWhoAreNotPresenter(): Vector[UserState] = {

View File

@ -37,20 +37,22 @@ trait MuteMeetingCmdMsgHdlr {
}
if (MeetingStatus2x.isMeetingMuted(liveMeeting.status)) {
MeetingStatus2x.unmuteMeeting(liveMeeting.status)
} else {
MeetingStatus2x.muteMeeting(liveMeeting.status)
}
if (msg.body.mute != MeetingStatus2x.isMeetingMuted(liveMeeting.status)) {
if (msg.body.mute) {
MeetingStatus2x.muteMeeting(liveMeeting.status)
} else {
MeetingStatus2x.unmuteMeeting(liveMeeting.status)
}
val muted = MeetingStatus2x.isMeetingMuted(liveMeeting.status)
val meetingMutedEvent = build(props.meetingProp.intId, msg.body.mutedBy, muted, msg.body.mutedBy)
val muted = MeetingStatus2x.isMeetingMuted(liveMeeting.status)
val meetingMutedEvent = build(props.meetingProp.intId, msg.body.mutedBy, muted, msg.body.mutedBy)
outGW.send(meetingMutedEvent)
outGW.send(meetingMutedEvent)
VoiceUsers.findAll(liveMeeting.voiceUsers) foreach { vu =>
if (!vu.listenOnly) {
muteUserInVoiceConf(vu, muted)
VoiceUsers.findAll(liveMeeting.voiceUsers) foreach { vu =>
if (!vu.listenOnly) {
muteUserInVoiceConf(vu, muted)
}
}
}
}

View File

@ -112,7 +112,7 @@ case class EjectUserFromVoiceCmdMsgBody(userId: String, ejectedBy: String)
object MuteAllExceptPresentersCmdMsg { val NAME = "MuteAllExceptPresentersCmdMsg"}
case class MuteAllExceptPresentersCmdMsg(header: BbbClientMsgHeader,
body: MuteAllExceptPresentersCmdMsgBody) extends StandardMsg
case class MuteAllExceptPresentersCmdMsgBody(mutedBy: String)
case class MuteAllExceptPresentersCmdMsgBody(mutedBy: String, mute: Boolean)
/**
* Sent by client to mute all users except presenters in the voice conference.
@ -133,7 +133,7 @@ case class IsMeetingMutedRespMsgBody(muted: Boolean)
object MuteUserCmdMsg { val NAME = "MuteUserCmdMsg"}
case class MuteUserCmdMsg(header: BbbClientMsgHeader,
body: MuteUserCmdMsgBody) extends StandardMsg
case class MuteUserCmdMsgBody(userId: String, mutedBy: String)
case class MuteUserCmdMsgBody(userId: String, mutedBy: String, mute: Boolean)
/**
* Sent to FS to get the users in the voice conference.
@ -165,7 +165,7 @@ case class GetUsersInVoiceConfSysMsgBody(voiceConf: String)
object MuteMeetingCmdMsg { val NAME = "MuteMeetingCmdMsg" }
case class MuteMeetingCmdMsg(header: BbbClientMsgHeader,
body: MuteMeetingCmdMsgBody) extends StandardMsg
case class MuteMeetingCmdMsgBody(mutedBy: String)
case class MuteMeetingCmdMsgBody(mutedBy: String, mute: Boolean)
/**
* Send to all clients that meeting is muted.

View File

@ -328,7 +328,7 @@ package org.bigbluebutton.modules.users.services
var message:Object = {
header: {name: "MuteMeetingCmdMsg", meetingId: UsersUtil.getInternalMeetingID(),
userId: UsersUtil.getMyUserID()},
body: {mutedBy: UsersUtil.getMyUserID()}
body: {mutedBy: UsersUtil.getMyUserID(), mute: mute}
};
var _nc:ConnectionManager = BBB.initConnectionManager();
@ -349,7 +349,7 @@ package org.bigbluebutton.modules.users.services
var message:Object = {
header: {name: "MuteAllExceptPresentersCmdMsg", meetingId: UsersUtil.getInternalMeetingID(),
userId: UsersUtil.getMyUserID()},
body: {mutedBy: UsersUtil.getMyUserID()}
body: {mutedBy: UsersUtil.getMyUserID(), mute: mute}
};
var _nc:ConnectionManager = BBB.initConnectionManager();
@ -370,7 +370,7 @@ package org.bigbluebutton.modules.users.services
var message:Object = {
header: {name: "MuteUserCmdMsg", meetingId: UsersUtil.getInternalMeetingID(),
userId: UsersUtil.getMyUserID()},
body: {userId: userid, mutedBy: UsersUtil.getMyUserID()}
body: {userId: userid, mutedBy: UsersUtil.getMyUserID(), mute: mute}
};
var _nc:ConnectionManager = BBB.initConnectionManager();