sync meeting lock settings status and handle GetLockSettingsRespMsg message. close #6669
This commit is contained in:
parent
66a6189bb5
commit
555ee1232a
@ -1,41 +1,39 @@
|
||||
package org.bigbluebutton.core.apps.users
|
||||
|
||||
import org.bigbluebutton.common2.msgs._
|
||||
import org.bigbluebutton.core.running.{ MeetingActor, OutMsgRouter }
|
||||
import org.bigbluebutton.core.running.{ MeetingActor, OutMsgRouter, LiveMeeting }
|
||||
import org.bigbluebutton.core2.MeetingStatus2x
|
||||
import org.bigbluebutton.core2.Permissions
|
||||
import org.bigbluebutton.core.bus.MessageBus
|
||||
import org.bigbluebutton.core.domain.MeetingState2x
|
||||
|
||||
trait GetLockSettingsReqMsgHdlr {
|
||||
this: MeetingActor =>
|
||||
|
||||
val outGW: OutMsgRouter
|
||||
|
||||
def buildLockSettingsResp(meetingId: String, requestedBy: String, settings: Permissions): BbbCommonEnvCoreMsg = {
|
||||
val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, meetingId, requestedBy)
|
||||
val envelope = BbbCoreEnvelope(GetLockSettingsRespMsg.NAME, routing)
|
||||
val body = GetLockSettingsRespMsgBody(
|
||||
disableCam = settings.disableCam,
|
||||
disableMic = settings.disableMic, disablePrivChat = settings.disablePrivChat,
|
||||
disablePubChat = settings.disablePubChat, lockedLayout = settings.lockedLayout,
|
||||
lockOnJoin = settings.lockOnJoin, lockOnJoinConfigurable = settings.lockOnJoinConfigurable)
|
||||
val header = BbbClientMsgHeader(GetLockSettingsRespMsg.NAME, meetingId, requestedBy)
|
||||
val event = GetLockSettingsRespMsg(header, body)
|
||||
BbbCommonEnvCoreMsg(envelope, event)
|
||||
}
|
||||
def buildNotInitializedResp(meetingId: String, requestedBy: String): BbbCommonEnvCoreMsg = {
|
||||
val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, meetingId, requestedBy)
|
||||
val envelope = BbbCoreEnvelope(LockSettingsNotInitializedRespMsg.NAME, routing)
|
||||
val body = LockSettingsNotInitializedRespMsgBody(requestedBy)
|
||||
val header = BbbClientMsgHeader(LockSettingsNotInitializedRespMsg.NAME, meetingId, requestedBy)
|
||||
val event = LockSettingsNotInitializedRespMsg(header, body)
|
||||
BbbCommonEnvCoreMsg(envelope, event)
|
||||
}
|
||||
|
||||
def handleGetLockSettingsReqMsg(msg: GetLockSettingsReqMsg): Unit = {
|
||||
|
||||
def buildLockSettingsResp(meetingId: String, requestedBy: String, settings: Permissions): BbbCommonEnvCoreMsg = {
|
||||
val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, meetingId, requestedBy)
|
||||
val envelope = BbbCoreEnvelope(GetLockSettingsRespMsg.NAME, routing)
|
||||
val body = GetLockSettingsRespMsgBody(
|
||||
disableCam = settings.disableCam,
|
||||
disableMic = settings.disableMic, disablePrivChat = settings.disablePrivChat,
|
||||
disablePubChat = settings.disablePubChat, lockedLayout = settings.lockedLayout,
|
||||
lockOnJoin = settings.lockOnJoin, lockOnJoinConfigurable = settings.lockOnJoinConfigurable)
|
||||
val header = BbbClientMsgHeader(GetLockSettingsRespMsg.NAME, meetingId, requestedBy)
|
||||
val event = GetLockSettingsRespMsg(header, body)
|
||||
|
||||
BbbCommonEnvCoreMsg(envelope, event)
|
||||
}
|
||||
|
||||
def buildNotInitializedResp(meetingId: String, requestedBy: String): BbbCommonEnvCoreMsg = {
|
||||
val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, meetingId, requestedBy)
|
||||
val envelope = BbbCoreEnvelope(LockSettingsNotInitializedRespMsg.NAME, routing)
|
||||
val body = LockSettingsNotInitializedRespMsgBody(requestedBy)
|
||||
val header = BbbClientMsgHeader(LockSettingsNotInitializedRespMsg.NAME, meetingId, requestedBy)
|
||||
val event = LockSettingsNotInitializedRespMsg(header, body)
|
||||
|
||||
BbbCommonEnvCoreMsg(envelope, event)
|
||||
}
|
||||
|
||||
if (MeetingStatus2x.permisionsInitialized(liveMeeting.status)) {
|
||||
val settings = MeetingStatus2x.getPermissions(liveMeeting.status)
|
||||
val event = buildLockSettingsResp(props.meetingProp.intId, msg.body.requesterId, settings)
|
||||
@ -45,4 +43,17 @@ trait GetLockSettingsReqMsgHdlr {
|
||||
outGW.send(event)
|
||||
}
|
||||
}
|
||||
|
||||
def handleSyncGetLockSettingsMsg(state: MeetingState2x, liveMeeting: LiveMeeting, bus: MessageBus): MeetingState2x = {
|
||||
if (MeetingStatus2x.permisionsInitialized(liveMeeting.status)) {
|
||||
val settings = MeetingStatus2x.getPermissions(liveMeeting.status)
|
||||
val event = buildLockSettingsResp(props.meetingProp.intId, "nodeJSapp", settings)
|
||||
bus.outGW.send(event)
|
||||
} else {
|
||||
val event = buildNotInitializedResp(props.meetingProp.intId, "nodeJSapp")
|
||||
bus.outGW.send(event)
|
||||
}
|
||||
|
||||
state
|
||||
}
|
||||
}
|
||||
|
@ -453,7 +453,9 @@ class MeetingActor(
|
||||
// sync all voice users
|
||||
handleSyncGetVoiceUsersMsg(state, liveMeeting, msgBus)
|
||||
|
||||
// TODO send all lock settings
|
||||
// sync all lock settings
|
||||
handleSyncGetLockSettingsMsg(state, liveMeeting, msgBus)
|
||||
|
||||
// TODO send all screen sharing info
|
||||
|
||||
}
|
||||
|
@ -18,3 +18,4 @@ RedisPubSub.on('UserLockedInMeetingEvtMsg', handleUserLockChange);
|
||||
RedisPubSub.on('RecordingStatusChangedEvtMsg', handleRecordingStatusChange);
|
||||
RedisPubSub.on('UpdateRecordingTimerEvtMsg', handleRecordingTimerChange);
|
||||
RedisPubSub.on('WebcamsOnlyForModeratorChangedEvtMsg', handleChangeWebcamOnlyModerator);
|
||||
RedisPubSub.on('GetLockSettingsRespMsg', handleMeetingLocksChange);
|
||||
|
@ -19,7 +19,7 @@ export default function toggleLockSettings(credentials, meeting) {
|
||||
lockedLayout: Boolean,
|
||||
lockOnJoin: Boolean,
|
||||
lockOnJoinConfigurable: Boolean,
|
||||
setBy: String,
|
||||
setBy: Match.Maybe(String),
|
||||
});
|
||||
|
||||
const payload = {
|
||||
|
@ -12,7 +12,7 @@ export default function changeLockSettings(meetingId, payload) {
|
||||
lockedLayout: Boolean,
|
||||
lockOnJoin: Boolean,
|
||||
lockOnJoinConfigurable: Boolean,
|
||||
setBy: String,
|
||||
setBy: Match.Maybe(String),
|
||||
});
|
||||
|
||||
const selector = {
|
||||
|
Loading…
Reference in New Issue
Block a user