Merge pull request #4033 from ritzalam/refactor-client

Merging Anton's poll PR and fixes
This commit is contained in:
Richard Alam 2017-06-28 11:03:07 -04:00 committed by GitHub
commit e9b669349e
278 changed files with 2012 additions and 2835 deletions

View File

@ -109,11 +109,6 @@ public interface IBigBlueButtonInGW {
void sendPrivateMessage(String meetingID, String requesterID, Map<String, String> message);
void clearPublicChatHistory(String meetingID, String requesterID);
// Caption
void sendCaptionHistory(String meetingID, String requesterID);
void updateCaptionOwner(String meetingID, String locale, String localeCode, String ownerID);
void editCaptionHistory(String meetingID, String userID, Integer startIndex, Integer endIndex, String locale, String localeCode, String text);
// DeskShare
void deskShareStarted(String confId, String callerId, String callerIdName);
void deskShareStopped(String conferenceName, String callerId, String callerIdName);

View File

@ -1,44 +0,0 @@
package org.bigbluebutton.core.pubsub.receivers;
import org.bigbluebutton.common.messages.MessagingConstants;
import org.bigbluebutton.common.messages.EditCaptionHistoryMessage;
import org.bigbluebutton.common.messages.SendCaptionHistoryRequestMessage;
import org.bigbluebutton.common.messages.UpdateCaptionOwnerMessage;
import com.google.gson.JsonParser;
import com.google.gson.JsonObject;
import org.bigbluebutton.core.api.IBigBlueButtonInGW;
public class CaptionMessageReceiver implements MessageHandler{
private IBigBlueButtonInGW bbbGW;
public CaptionMessageReceiver(IBigBlueButtonInGW bbbGW) {
this.bbbGW = bbbGW;
}
@Override
public void handleMessage(String pattern, String channel, String message) {
if (channel.equalsIgnoreCase(MessagingConstants.TO_CAPTION_CHANNEL)) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (SendCaptionHistoryRequestMessage.SEND_CAPTION_HISTORY_REQUEST.equals(messageName)){
SendCaptionHistoryRequestMessage msg = SendCaptionHistoryRequestMessage.fromJson(message);
bbbGW.sendCaptionHistory(msg.meetingID, msg.requesterID);
} else if (UpdateCaptionOwnerMessage.UPDATE_CAPTION_OWNER.equals(messageName)) {
UpdateCaptionOwnerMessage msg = UpdateCaptionOwnerMessage.fromJson(message);
bbbGW.updateCaptionOwner(msg.meetingID, msg.locale, msg.localeCode, msg.ownerID);
} else if (EditCaptionHistoryMessage.EDIT_CAPTION_HISTORY.equals(messageName)) {
EditCaptionHistoryMessage msg = EditCaptionHistoryMessage.fromJson(message);
bbbGW.editCaptionHistory(msg.meetingID, msg.userID, msg.startIndex, msg.endIndex, msg.locale, msg.localeCode, msg.text);
}
}
}
}
}
}

View File

@ -51,9 +51,6 @@ public class RedisMessageReceiver {
MeetingMessageReceiver meetingRx = new MeetingMessageReceiver(bbbGW);
receivers.add(meetingRx);
CaptionMessageReceiver captionRx = new CaptionMessageReceiver(bbbGW);
receivers.add(captionRx);
SharedNotesMessageReceiver notesRx = new SharedNotesMessageReceiver(bbbGW);
receivers.add(notesRx);

View File

@ -6,15 +6,12 @@ import akka.actor._
import akka.actor.ActorLogging
import akka.actor.SupervisorStrategy.Resume
import akka.util.Timeout
import scala.concurrent.duration._
import org.bigbluebutton.core.bus._
import org.bigbluebutton.core.api._
import org.bigbluebutton.SystemConfiguration
import java.util.concurrent.TimeUnit
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.users.RegisterUserReqMsg
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.running.RunningMeeting
import org.bigbluebutton.core2.RunningMeetings
@ -319,7 +316,7 @@ class BigBlueButtonActor(val system: ActorSystem,
eventBus.publish(BigBlueButtonEvent(id, new DeskShareGetDeskShareInfoRequest(id, html5clientRequesterID, html5clientRequesterID)))
// send captions
eventBus.publish(BigBlueButtonEvent(id, new SendCaptionHistoryRequest(id, html5clientRequesterID)))
//eventBus.publish(BigBlueButtonEvent(id, new SendCaptionHistoryRequest(id, html5clientRequesterID)))
})
outGW.send(new GetAllMeetingsReply(resultArray))

View File

@ -2,9 +2,7 @@ package org.bigbluebutton.core
import org.bigbluebutton.core.bus._
import org.bigbluebutton.core.api._
import scala.collection.JavaConversions._
import org.bigbluebutton.core.apps.Page
import org.bigbluebutton.core.apps.Presentation
import akka.actor.ActorSystem
import org.bigbluebutton.common.messages.IBigBlueButtonMessage
@ -14,7 +12,7 @@ import org.bigbluebutton.messages._
import akka.event.Logging
import org.bigbluebutton.SystemConfiguration
import org.bigbluebutton.common2.domain.PageVO
import org.bigbluebutton.core.models.Roles
import org.bigbluebutton.core.models.{ GuestPolicyType, Roles }
import scala.collection.JavaConverters
@ -46,11 +44,11 @@ class BigBlueButtonInGW(
case msg: CreateMeetingRequest => {
val policy = msg.payload.guestPolicy.toUpperCase() match {
case "ALWAYS_ACCEPT" => GuestPolicy.ALWAYS_ACCEPT
case "ALWAYS_DENY" => GuestPolicy.ALWAYS_DENY
case "ASK_MODERATOR" => GuestPolicy.ASK_MODERATOR
case "ALWAYS_ACCEPT" => GuestPolicyType.ALWAYS_ACCEPT
case "ALWAYS_DENY" => GuestPolicyType.ALWAYS_DENY
case "ASK_MODERATOR" => GuestPolicyType.ASK_MODERATOR
//default
case undef => GuestPolicy.ASK_MODERATOR
case undef => GuestPolicyType.ASK_MODERATOR
}
/*
val mProps = new MeetingProperties(
@ -301,11 +299,11 @@ class BigBlueButtonInGW(
def setGuestPolicy(meetingId: String, guestPolicy: String, requesterId: String) {
val policy = guestPolicy.toUpperCase() match {
case "ALWAYS_ACCEPT" => GuestPolicy.ALWAYS_ACCEPT
case "ALWAYS_DENY" => GuestPolicy.ALWAYS_DENY
case "ASK_MODERATOR" => GuestPolicy.ASK_MODERATOR
case "ALWAYS_ACCEPT" => GuestPolicyType.ALWAYS_ACCEPT
case "ALWAYS_DENY" => GuestPolicyType.ALWAYS_DENY
case "ASK_MODERATOR" => GuestPolicyType.ASK_MODERATOR
//default
case undef => GuestPolicy.ASK_MODERATOR
case undef => GuestPolicyType.ASK_MODERATOR
}
eventBus.publish(BigBlueButtonEvent(meetingId, new SetGuestPolicy(meetingId, policy, requesterId)))
}
@ -545,24 +543,6 @@ class BigBlueButtonInGW(
}
}
/**
* *******************************************************************
* Message Interface for Caption
* *****************************************************************
*/
def sendCaptionHistory(meetingID: String, requesterID: String) {
eventBus.publish(BigBlueButtonEvent(meetingID, new SendCaptionHistoryRequest(meetingID, requesterID)))
}
def updateCaptionOwner(meetingID: String, locale: String, localeCode: String, ownerID: String) {
eventBus.publish(BigBlueButtonEvent(meetingID, new UpdateCaptionOwnerRequest(meetingID, locale, localeCode, ownerID)))
}
def editCaptionHistory(meetingID: String, userID: String, startIndex: Integer, endIndex: Integer, locale: String, localeCode: String, text: String) {
eventBus.publish(BigBlueButtonEvent(meetingID, new EditCaptionHistoryRequest(meetingID, userID, startIndex, endIndex, locale, localeCode, text)))
}
/**
* *******************************************************************
* Message Interface for Shared Notes

View File

@ -1,10 +1,6 @@
package org.bigbluebutton.core
import org.bigbluebutton.core.api.GuestPolicy
import org.bigbluebutton.core.api.Permissions
import java.util.concurrent.TimeUnit
import org.bigbluebutton.core.api.GuestPolicy.GuestPolicy
case object StopMeetingActor
@ -21,7 +17,6 @@ class MeetingModel {
private var muted = false
private var meetingEnded = false
private var meetingMuted = false
private var guestPolicy = GuestPolicy.ASK_MODERATOR
private var guestPolicySetBy: String = null
private var hasLastWebUserLeft = false

View File

@ -1,6 +1,6 @@
package org.bigbluebutton.core
import org.bigbluebutton.common2.messages.BbbCoreMsg
import org.bigbluebutton.common2.msgs.BbbCoreMsg
object MessageRecorder {
def record(outGW: OutMessageGateway, record: Boolean, msg: BbbCoreMsg): Unit = {

View File

@ -13,7 +13,6 @@ import org.bigbluebutton.common.messages.StartRecordingVoiceConfRequestMessage
import org.bigbluebutton.common.messages.StopRecordingVoiceConfRequestMessage
import org.bigbluebutton.core.pubsub.senders.MeetingMessageToJsonConverter
import org.bigbluebutton.core.pubsub.senders.PesentationMessageToJsonConverter
import org.bigbluebutton.core.pubsub.senders.CaptionMessageToJsonConverter
import org.bigbluebutton.core.pubsub.senders.DeskShareMessageToJsonConverter
import org.bigbluebutton.common.messages.GetPresentationInfoReplyMessage
import org.bigbluebutton.common.messages.PresentationRemovedMessage
@ -139,9 +138,6 @@ class MessageSenderActor(val service: MessageSender)
case msg: MeetingTimeRemainingUpdate => handleMeetingTimeRemainingUpdate(msg)
case msg: BreakoutRoomsTimeRemainingUpdateOutMessage => handleBreakoutRoomsTimeRemainingUpdate(msg)
case msg: SendCaptionHistoryReply => handleSendCaptionHistoryReply(msg)
case msg: UpdateCaptionOwnerReply => handleUpdateCaptionOwnerReply(msg)
case msg: EditCaptionHistoryReply => handleEditCaptionHistoryReply(msg)
case msg: DeskShareStartRTMPBroadcast => handleDeskShareStartRTMPBroadcast(msg)
case msg: DeskShareStopRTMPBroadcast => handleDeskShareStopRTMPBroadcast(msg)
case msg: DeskShareNotifyViewersRTMP => handleDeskShareNotifyViewersRTMP(msg)
@ -707,23 +703,6 @@ class MessageSenderActor(val service: MessageSender)
service.send(MessagingConstants.FROM_USERS_CHANNEL, json)
}
private def handleSendCaptionHistoryReply(msg: SendCaptionHistoryReply) {
val json = CaptionMessageToJsonConverter.sendCaptionHistoryReplyToJson(msg)
service.send(MessagingConstants.FROM_CAPTION_CHANNEL, json)
}
private def handleUpdateCaptionOwnerReply(msg: UpdateCaptionOwnerReply) {
val json = CaptionMessageToJsonConverter.updateCaptionOwnerReplyToJson(msg)
service.send(MessagingConstants.FROM_CAPTION_CHANNEL, json)
}
private def handleEditCaptionHistoryReply(msg: EditCaptionHistoryReply) {
println("handleEditCaptionHistoryReply")
val json = CaptionMessageToJsonConverter.editCaptionHistoryReplyToJson(msg)
println(json)
service.send(MessagingConstants.FROM_CAPTION_CHANNEL, json)
}
private def handleBreakoutRoomsTimeRemainingUpdate(msg: BreakoutRoomsTimeRemainingUpdateOutMessage) {
val json = MeetingMessageToJsonConverter.breakoutRoomsTimeRemainingUpdateToJson(msg)
service.send(MessagingConstants.FROM_USERS_CHANNEL, json)

View File

@ -1,7 +1,7 @@
package org.bigbluebutton.core
import org.bigbluebutton.SystemConfiguration
import org.bigbluebutton.common2.messages.{ BbbCommonEnvCoreMsg, BbbCoreMsg }
import org.bigbluebutton.common2.msgs.{ BbbCommonEnvCoreMsg, BbbCoreMsg }
import org.bigbluebutton.core.bus._
import org.bigbluebutton.core.api.IOutMessage

View File

@ -1,12 +1,9 @@
package org.bigbluebutton.core.api
import org.bigbluebutton.common2.messages.breakoutrooms.BreakoutUserVO
import org.bigbluebutton.core.api.GuestPolicy.GuestPolicy
import org.bigbluebutton.common2.msgs.BreakoutUserVO
import org.bigbluebutton.core.api.SharedNotesOperation.SharedNotesOperation
import org.bigbluebutton.core.apps.Presentation
import spray.json.JsObject
case class InMessageHeader(name: String)
case class InHeaderAndJsonPayload(header: InMessageHeader, payload: JsObject)
case class MessageProcessException(message: String) extends Exception(message)
@ -116,7 +113,7 @@ case class UserDisconnectedFromGlobalAudio(meetingID: String, /** Not used. Just
///////////////////////////////////////////////////////////////////////////////////////
case class GetGuestPolicy(meetingID: String, requesterID: String) extends InMessage
case class SetGuestPolicy(meetingID: String, policy: GuestPolicy, setBy: String) extends InMessage
case class SetGuestPolicy(meetingID: String, policy: String, setBy: String) extends InMessage
case class RespondToGuest(meetingID: String, userId: String, response: Boolean, requesterID: String) extends InMessage
///////////////////////////////////////////////////////////////////////////////////////
@ -189,10 +186,6 @@ case class VoiceConfRecordingStartedMessage(voiceConfId: String, recordStream: S
// No idea what part this is for
case class GetAllMeetingsRequest(meetingID: String /** Not used. Just to satisfy trait **/ ) extends InMessage
// Caption
case class SendCaptionHistoryRequest(meetingID: String, requesterID: String) extends InMessage
case class UpdateCaptionOwnerRequest(meetingID: String, locale: String, localeCode: String, ownerID: String) extends InMessage
case class EditCaptionHistoryRequest(meetingID: String, userID: String, startIndex: Integer, endIndex: Integer, locale: String, localeCode: String, text: String) extends InMessage
// DeskShare
case class DeskShareStartedRequest(conferenceName: String, callerId: String, callerIdName: String) extends InMessage
case class DeskShareStoppedRequest(conferenceName: String, callerId: String, callerIdName: String) extends InMessage

View File

@ -74,12 +74,6 @@ object MessageNames {
val VOICE_USER_MUTED = "voice_user_muted_message"
val VOICE_USER_TALKING = "voice_user_talking_message"
val VOICE_RECORDING = "voice_recording_message"
val SEND_WHITEBOARD_ANNOTATION = "send_whiteboard_annotation_request"
val GET_WHITEBOARD_SHAPES = "get_whiteboard_shapes_request"
val CLEAR_WHITEBOARD = "clear_whiteboard_request"
val UNDO_WHITEBOARD = "undo_whiteboard_request"
val ENABLE_WHITEBOARD = "enable_whiteboard_request"
val IS_WHITEBOARD_ENABLED = "is_whiteboard_enabled_request"
var GET_GUEST_POLICY = "get_guest_policy"
val SET_GUEST_POLICY = "set_guest_policy"
val RESPOND_TO_GUEST = "respond_to_guest"
@ -160,20 +154,10 @@ object MessageNames {
val GET_PRESENTATION_STATUS_REPLY = "get_presentation_status_reply"
val PRESENTATION_REMOVED_MESSAGE = "presentation_removed_message"
val PRESENTATION_PAGE_GENERATED = "presentation_page_generated_message"
val GET_WHITEBOARD_SHAPES_REPLY = "get_whiteboard_shapes_reply"
val SEND_WHITEBOARD_SHAPE = "send_whiteboard_shape_message"
val CURSOR_POSITION_UPDATED = "cursor_position_updated_message"
val UNDO_WHITEBOARD_MESSAGE = "undo_whiteboard_message"
val MODIFIED_WHITEBOARD_ACCESS = "modified_whiteboard_access_message"
val GET_WHITEBOARD_ACCESS_REPLY = "get_whiteboard_access_reply"
val WHITEBOARD_CLEARED = "whiteboard_cleared_message"
val MEETING_DESTROYED_EVENT = "meeting_destroyed_event"
val KEEP_ALIVE_REPLY = "keep_alive_reply"
val USER_LISTEN_ONLY = "user_listening_only"
val GET_ALL_MEETINGS_REPLY = "get_all_meetings_reply_message"
val EDIT_CAPTION_HISTORY = "edit_caption_history_message"
val UPDATE_CAPTION_OWNER = "update_caption_owner_message"
val SEND_CAPTION_HISTORY_REPLY = "send_caption_history_reply_message"
// breakout rooms
val BREAKOUT_ROOM_STARTED = "BreakoutRoomStarted"

View File

@ -1,9 +1,9 @@
package org.bigbluebutton.core.api
import org.bigbluebutton.common2.messages.breakoutrooms._
import org.bigbluebutton.core.apps._
import org.bigbluebutton.core.models._
import org.bigbluebutton.common2.domain.UserVO
import org.bigbluebutton.common2.msgs.{ BreakoutRoomInfo, BreakoutUserVO }
case class VoiceRecordingStarted(meetingID: String, recorded: Boolean, recordingFile: String, timestamp: String, confNum: String) extends IOutMessage
case class VoiceRecordingStopped(meetingID: String, recorded: Boolean, recordingFile: String, timestamp: String, confNum: String) extends IOutMessage
@ -138,10 +138,6 @@ case class GetCurrentPollReplyMessage(meetingID: String, recorded: Boolean, requ
// No idea what part this is for
case class GetAllMeetingsReply(meetings: Array[MeetingInfo]) extends IOutMessage
// Caption
case class SendCaptionHistoryReply(meetingID: String, recorded: Boolean, requesterID: String, history: Map[String, Array[String]]) extends IOutMessage
case class UpdateCaptionOwnerReply(meetingID: String, recorded: Boolean, locale: String, localeCode: String, ownerID: String) extends IOutMessage
case class EditCaptionHistoryReply(meetingID: String, recorded: Boolean, userID: String, startIndex: Integer, endIndex: Integer, locale: String, localeCode: String, text: String) extends IOutMessage
// DeskShare
case class DeskShareStartRTMPBroadcast(conferenceName: String, streamPath: String) extends IOutMessage
case class DeskShareStopRTMPBroadcast(conferenceName: String, streamPath: String) extends IOutMessage
@ -163,4 +159,3 @@ case class SharedNotesSyncNoteReply(meetingID: String, recorded: Boolean, reques
// Value Objects
case class MeetingVO(id: String, recorded: Boolean)

View File

@ -2,6 +2,8 @@ package org.bigbluebutton.core.api
import java.lang.Boolean
import org.bigbluebutton.core.models.GuestPolicyType
import scala.collection.mutable.Stack
object Metadata extends Enumeration {
@ -10,13 +12,6 @@ object Metadata extends Enumeration {
val INACTIVITY_TIMELEFT = "inactivity-timeleft"
}
object GuestPolicy extends Enumeration {
type GuestPolicy = Value
val ALWAYS_ACCEPT = Value("ALWAYS_ACCEPT")
val ALWAYS_DENY = Value("ALWAYS_DENY")
val ASK_MODERATOR = Value("ASK_MODERATOR")
}
object SharedNotesOperation extends Enumeration {
type SharedNotesOperation = Value
val PATCH = Value("PATCH")
@ -101,7 +96,7 @@ case class MeetingConfig(name: String,
duration: MeetingDuration,
defaultAvatarURL: String,
defaultConfigToken: String,
guestPolicy: GuestPolicy.GuestPolicy = GuestPolicy.ASK_MODERATOR)
guestPolicy: String = GuestPolicyType.ASK_MODERATOR)
case class MeetingName(name: String)

View File

@ -4,18 +4,17 @@ import java.net.URLEncoder
import scala.collection.SortedSet
import scala.collection.mutable
import org.apache.commons.codec.digest.DigestUtils
import org.bigbluebutton.SystemConfiguration
import org.bigbluebutton.common2.msgs.{ BreakoutRoomInfo, BreakoutUserVO }
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api._
import org.bigbluebutton.core.bus.BigBlueButtonEvent
import org.bigbluebutton.core.bus.IncomingEventBus
import org.bigbluebutton.core.models.BreakoutRooms
import org.bigbluebutton.core.models.Users
import org.bigbluebutton.core.models.Users1x
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core2.MeetingStatus2x
import org.bigbluebutton.common2.messages.breakoutrooms._
trait BreakoutRoomApp extends SystemConfiguration {
this: MeetingActor =>
@ -24,7 +23,10 @@ trait BreakoutRoomApp extends SystemConfiguration {
val eventBus: IncomingEventBus
def handleBreakoutRoomsList(msg: BreakoutRoomsListMessage) {
val breakoutRooms = BreakoutRooms.getRooms(liveMeeting.breakoutRooms).toVector map { r => new BreakoutRoomInfo(r.name, r.externalMeetingId, r.id, r.sequence) }
val breakoutRooms = BreakoutRooms.getRooms(liveMeeting.breakoutRooms).toVector map { r =>
new BreakoutRoomInfo(r.name, r.externalMeetingId, r.id, r.sequence)
}
val roomsReady = liveMeeting.breakoutRooms.pendingRoomsNumber == 0 && breakoutRooms.length > 0
log.info("Sending breakout rooms list to {} with containing {} room(s)", props.meetingProp.intId, breakoutRooms.length)
outGW.send(new BreakoutRoomsListOutMessage(props.meetingProp.intId, breakoutRooms, roomsReady))
@ -73,7 +75,7 @@ trait BreakoutRoomApp extends SystemConfiguration {
def sendJoinURL(userId: String, externalMeetingId: String, roomSequence: String) {
log.debug("Sending breakout meeting {} Join URL for user: {}", externalMeetingId, userId)
for {
user <- Users.findWithId(userId, liveMeeting.users)
user <- Users1x.findWithId(userId, liveMeeting.users)
apiCall = "join"
params = BreakoutRoomsUtil.joinParams(user.name, userId + "-" + roomSequence, true,
externalMeetingId, props.password.moderatorPass)
@ -136,7 +138,7 @@ trait BreakoutRoomApp extends SystemConfiguration {
}
def handleSendBreakoutUsersUpdate(msg: SendBreakoutUsersUpdate) {
val users = Users.getUsers(liveMeeting.users)
val users = Users1x.getUsers(liveMeeting.users)
val breakoutUsers = users map { u => new BreakoutUserVO(u.externalId, u.name) }
eventBus.publish(BigBlueButtonEvent(props.breakoutProps.parentId,
new BreakoutRoomUsersUpdate(props.breakoutProps.parentId, props.meetingProp.intId, breakoutUsers)))
@ -157,7 +159,7 @@ trait BreakoutRoomApp extends SystemConfiguration {
targetVoiceBridge = props.voiceProp.voiceConf.dropRight(1)
}
// We check the user from the mode
Users.findWithId(msg.userId, liveMeeting.users) match {
Users1x.findWithId(msg.userId, liveMeeting.users) match {
case Some(u) => {
if (u.voiceUser.joined) {
log.info("Transferring user userId=" + u.id + " from voiceBridge=" + props.voiceProp.voiceConf + " to targetVoiceConf=" + targetVoiceBridge)

View File

@ -1,56 +0,0 @@
package org.bigbluebutton.core.apps
import org.bigbluebutton.core.api._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.running.{ MeetingActor }
trait CaptionApp {
this: MeetingActor =>
val outGW: OutMessageGateway
def handleSendCaptionHistoryRequest(msg: SendCaptionHistoryRequest) {
val history = liveMeeting.captionModel.getHistory()
//println("Caption history requested " + history)
outGW.send(new SendCaptionHistoryReply(props.meetingProp.intId, props.recordProp.record, msg.requesterID, history))
}
def handleUpdateCaptionOwnerRequest(msg: UpdateCaptionOwnerRequest) {
// clear owner from previous locale
if (msg.ownerID.length > 0) {
liveMeeting.captionModel.findLocaleByOwnerId(msg.ownerID).foreach(t => {
liveMeeting.captionModel.changeTranscriptOwner(t, "")
// send notification that owner has changed
outGW.send(new UpdateCaptionOwnerReply(props.meetingProp.intId, props.recordProp.record, t, liveMeeting.captionModel.findLocaleCodeByLocale(t), ""))
})
}
// create the locale if it doesn't exist
if (liveMeeting.captionModel.transcripts contains msg.locale) {
liveMeeting.captionModel.changeTranscriptOwner(msg.locale, msg.ownerID)
} else { // change the owner if it does exist
liveMeeting.captionModel.newTranscript(msg.locale, msg.localeCode, msg.ownerID)
}
outGW.send(new UpdateCaptionOwnerReply(props.meetingProp.intId, props.recordProp.record, msg.locale, msg.localeCode, msg.ownerID))
}
def handleEditCaptionHistoryRequest(msg: EditCaptionHistoryRequest) {
liveMeeting.captionModel.findLocaleByOwnerId(msg.userID).foreach(t => {
if (t == msg.locale) {
liveMeeting.captionModel.editHistory(msg.startIndex, msg.endIndex, msg.locale, msg.text)
outGW.send(new EditCaptionHistoryReply(props.meetingProp.intId, props.recordProp.record, msg.userID, msg.startIndex, msg.endIndex, msg.locale, msg.localeCode, msg.text))
}
})
}
def checkCaptionOwnerLogOut(userId: String) {
liveMeeting.captionModel.findLocaleByOwnerId(userId).foreach(t => {
liveMeeting.captionModel.changeTranscriptOwner(t, "")
// send notification that owner has changed
outGW.send(new UpdateCaptionOwnerReply(props.meetingProp.intId, props.recordProp.record, t, liveMeeting.captionModel.findLocaleCodeByLocale(t), ""))
})
}
}

View File

@ -1,58 +1,90 @@
package org.bigbluebutton.core.apps
class CaptionModel {
var transcripts = Map[String, Array[String]]()
import org.bigbluebutton.common2.msgs.TranscriptVO
import scala.collection.immutable.HashMap
def newTranscript(locale: String, localeCode: String, ownerId: String) {
transcripts += locale -> Array(ownerId, "", localeCode)
class CaptionModel {
private var transcripts = new HashMap[String, TranscriptVO]()
private def createTranscript(locale: String, localeCode: String, ownerId: String): TranscriptVO = {
val transcript = TranscriptVO(ownerId, "", localeCode)
transcripts += locale -> transcript
transcript
}
def findLocaleByOwnerId(userId: String): Option[String] = {
transcripts.find(_._2(0) == userId).foreach(t => {
return Some(t._1)
private def findTranscriptByOwnerId(userId: String): Option[(String, TranscriptVO)] = {
transcripts.find(_._2.ownerId == userId).foreach(t => {
return Some(t)
})
return None
}
def findLocaleCodeByLocale(locale: String): String = {
def updateTranscriptOwner(locale: String, localeCode: String, ownerId: String): Map[String, TranscriptVO] = {
var updatedTranscripts = new HashMap[String, TranscriptVO]
// clear owner from previous locale
if (ownerId.length > 0) {
findTranscriptByOwnerId(ownerId).foreach(t => {
val oldTranscript = t._2.copy(ownerId = "")
transcripts += t._1 -> oldTranscript
updatedTranscripts += t._1 -> oldTranscript
})
}
// change the owner if it does exist
if (transcripts contains locale) {
return transcripts(locale)(2)
val newTranscript = transcripts(locale).copy(ownerId = ownerId)
transcripts += locale -> newTranscript
updatedTranscripts += locale -> newTranscript
} else { // create the locale if it doesn't exist
val addedTranscript = createTranscript(locale, localeCode, ownerId)
updatedTranscripts += locale -> addedTranscript
}
return ""
updatedTranscripts
}
def changeTranscriptOwner(locale: String, ownerId: String) {
if (transcripts contains locale) {
transcripts(locale)(0) = ownerId
}
def getHistory(): Map[String, TranscriptVO] = {
transcripts
}
def getHistory(): Map[String, Array[String]] = {
var history = Map[String, Array[String]]()
transcripts.foreach(t => {
history += t._1 -> Array(t._2(0), t._2(1), t._2(2))
})
history
}
def editHistory(startIndex: Integer, endIndex: Integer, locale: String, text: String) {
def editHistory(userId: String, startIndex: Integer, endIndex: Integer, locale: String, text: String): Boolean = {
var successfulEdit = false
//println("editHistory entered")
if (transcripts contains locale) {
//println("editHistory found locale:" + locale)
val oText: String = transcripts(locale)(1)
val oldTranscript = transcripts(locale)
if (oldTranscript.ownerId == userId) {
//println("editHistory found locale:" + locale)
val oText: String = transcripts(locale).text
if (startIndex >= 0 && endIndex <= oText.length && startIndex <= endIndex) {
//println("editHistory passed index test")
val sText: String = oText.substring(0, startIndex)
val eText: String = oText.substring(endIndex)
if (startIndex >= 0 && endIndex <= oText.length && startIndex <= endIndex) {
//println("editHistory passed index test")
val sText: String = oText.substring(0, startIndex)
val eText: String = oText.substring(endIndex)
transcripts(locale)(1) = (sText + text + eText)
//println("editHistory new history is: " + transcripts(locale)(1))
transcripts += locale -> transcripts(locale).copy(text = (sText + text + eText))
//println("editHistory new history is: " + transcripts(locale).text)
successfulEdit = true
}
}
}
successfulEdit
}
def checkCaptionOwnerLogOut(userId: String): Option[(String, TranscriptVO)] = {
var rtnTranscript: Option[(String, TranscriptVO)] = None
if (userId.length > 0) {
findTranscriptByOwnerId(userId).foreach(t => {
val oldTranscript = t._2.copy(ownerId = "")
transcripts += t._1 -> oldTranscript
rtnTranscript = Some((t._1, oldTranscript))
})
}
rtnTranscript
}
}

View File

@ -5,7 +5,7 @@ import org.bigbluebutton.common2.domain.UserVO
import scala.collection.mutable.ArrayBuffer
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api._
import org.bigbluebutton.core.models.{ Layouts, Roles, Users }
import org.bigbluebutton.core.models.{ Layouts, Roles, Users1x }
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core2.MeetingStatus2x
@ -54,14 +54,14 @@ trait LayoutApp {
def affectedUsers(): Array[UserVO] = {
if (Layouts.doesLayoutApplyToViewersOnly()) {
val au = ArrayBuffer[UserVO]()
Users.getUsers(liveMeeting.users) foreach { u =>
Users1x.getUsers(liveMeeting.users) foreach { u =>
if (!u.presenter && u.role != Roles.MODERATOR_ROLE) {
au += u
}
}
au.toArray
} else {
Users.getUsers(liveMeeting.users).toArray
Users1x.getUsers(liveMeeting.users).toArray
}
}

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core.apps
import org.bigbluebutton.core.api._
import scala.collection.mutable.ArrayBuffer
import org.bigbluebutton.core.models.Users
import org.bigbluebutton.core.models.Users1x
import org.bigbluebutton.core.running.{ MeetingActor }
import com.google.gson.Gson
import java.util.ArrayList
@ -133,7 +133,7 @@ trait PollApp {
page <- liveMeeting.presModel.getCurrentPage()
pageId = if (msg.pollId.contains("deskshare")) "deskshare" else page.id;
pollId = pageId + "/" + System.currentTimeMillis()
numRespondents = Users.numUsers(liveMeeting.users) - 1 // subtract the presenter
numRespondents = Users1x.numUsers(liveMeeting.users) - 1 // subtract the presenter
poll <- createPoll(pollId, numRespondents)
simplePoll <- PollModel.getSimplePoll(pollId, liveMeeting.pollModel)
} yield {
@ -157,7 +157,7 @@ trait PollApp {
page <- liveMeeting.presModel.getCurrentPage()
pageId = if (msg.pollId.contains("deskshare")) "deskshare" else page.id
pollId = pageId + "/" + System.currentTimeMillis()
numRespondents = Users.numUsers(liveMeeting.users) - 1 // subtract the presenter
numRespondents = Users1x.numUsers(liveMeeting.users) - 1 // subtract the presenter
poll <- createPoll(pollId, numRespondents)
simplePoll <- PollModel.getSimplePoll(pollId, liveMeeting.pollModel)
} yield {
@ -185,10 +185,10 @@ trait PollApp {
}
for {
user <- Users.findWithId(msg.requesterId, liveMeeting.users)
user <- Users1x.findWithId(msg.requesterId, liveMeeting.users)
responder = new Responder(user.id, user.name)
updatedPoll <- storePollResult(responder)
curPres <- Users.getCurrentPresenter(liveMeeting.users)
curPres <- Users1x.getCurrentPresenter(liveMeeting.users)
} yield outGW.send(new UserRespondedToPollMessage(props.meetingProp.intId, props.recordProp.record, curPres.id, msg.pollId, updatedPoll))
}

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core.apps
import org.bigbluebutton.core.api._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.Users
import org.bigbluebutton.core.models.Users1x
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core2.MeetingStatus2x

View File

@ -1,11 +1,9 @@
package org.bigbluebutton.core.apps
import org.bigbluebutton.common2.domain.UserVO
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.users.{ PresenterAssignedEvtMsg, PresenterAssignedEvtMsgBody }
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.api._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.GuestPolicy
import org.bigbluebutton.core.models._
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core2.MeetingStatus2x
@ -56,7 +54,7 @@ trait UsersApp extends UserLeavingHdlr with UserEmojiStatusHdlr {
}
def usersWhoAreNotPresenter(): Array[UserVO] = {
Users.usersWhoAreNotPresenter(liveMeeting.users).toArray
Users1x.usersWhoAreNotPresenter(liveMeeting.users).toArray
}
def makeSurePresenterIsAssigned(user: UserVO): Unit = {
@ -65,7 +63,7 @@ trait UsersApp extends UserLeavingHdlr with UserEmojiStatusHdlr {
* him presenter. This way, if there is a moderator in the meeting, there
* will always be a presenter.
*/
val moderator = Users.findAModerator(liveMeeting.users)
val moderator = Users1x.findAModerator(liveMeeting.users)
moderator.foreach { mod =>
log.info("Presenter left meeting. meetingId=" + props.meetingProp.intId + " userId=" + user.id
+ ". Making user=[" + mod.id + "] presenter.")
@ -93,7 +91,7 @@ trait UsersApp extends UserLeavingHdlr with UserEmojiStatusHdlr {
}
def stopRecordingVoiceConference() {
if (Users.numUsersInVoiceConference(liveMeeting.users) == 0 &&
if (Users1x.numUsersInVoiceConference(liveMeeting.users) == 0 &&
props.recordProp.record &&
MeetingStatus2x.isVoiceRecording(liveMeeting.status)) {
MeetingStatus2x.stopRecordingVoice(liveMeeting.status)
@ -108,15 +106,15 @@ trait UsersApp extends UserLeavingHdlr with UserEmojiStatusHdlr {
+ " userId=" + msg.voiceUserId)
for {
user <- Users.getUserWithVoiceUserId(msg.voiceUserId, liveMeeting.users)
nu = Users.resetVoiceUser(user, liveMeeting.users)
user <- Users1x.getUserWithVoiceUserId(msg.voiceUserId, liveMeeting.users)
nu = Users1x.resetVoiceUser(user, liveMeeting.users)
} yield {
log.info("User left voice conf. meetingId=" + props.meetingProp.intId + " userId=" + nu.id + " user=" + nu)
outGW.send(new UserLeftVoice(props.meetingProp.intId, props.recordProp.record, props.voiceProp.voiceConf, nu))
if (user.phoneUser) {
for {
userLeaving <- Users.userLeft(user.id, liveMeeting.users)
userLeaving <- Users1x.userLeft(user.id, liveMeeting.users)
} yield {
outGW.send(new UserLeft(props.meetingProp.intId, props.recordProp.record, userLeaving))
}
@ -137,18 +135,18 @@ trait UsersApp extends UserLeavingHdlr with UserEmojiStatusHdlr {
def removePresenterRightsToCurrentPresenter(): Unit = {
for {
curPres <- Users.getCurrentPresenter(liveMeeting.users)
curPres <- Users1x.getCurrentPresenter(liveMeeting.users)
} yield {
Users.unbecomePresenter(curPres.id, liveMeeting.users)
Users1x.unbecomePresenter(curPres.id, liveMeeting.users)
outGW.send(new UserStatusChange(props.meetingProp.intId, props.recordProp.record, curPres.id, "presenter", false: java.lang.Boolean))
}
}
for {
newPres <- Users.findWithId(newPresenterID, liveMeeting.users)
newPres <- Users1x.findWithId(newPresenterID, liveMeeting.users)
} yield {
removePresenterRightsToCurrentPresenter()
Users.becomePresenter(newPres.id, liveMeeting.users)
Users1x.becomePresenter(newPres.id, liveMeeting.users)
MeetingStatus2x.setCurrentPresenterInfo(liveMeeting.status, new Presenter(newPresenterID, newPresenterName, assignedBy))
outGW.send(new PresenterAssigned(props.meetingProp.intId, props.recordProp.record, new Presenter(newPresenterID, newPresenterName, assignedBy)))
outGW.send(new UserStatusChange(props.meetingProp.intId, props.recordProp.record, newPresenterID, "presenter", true: java.lang.Boolean))
@ -156,17 +154,17 @@ trait UsersApp extends UserLeavingHdlr with UserEmojiStatusHdlr {
}
def handleRespondToGuest(msg: RespondToGuest) {
if (Users.isModerator(msg.requesterID, liveMeeting.users)) {
if (Users1x.isModerator(msg.requesterID, liveMeeting.users)) {
var usersToAnswer: Array[UserVO] = null;
if (msg.userId == null) {
usersToAnswer = Users.getUsers(liveMeeting.users).filter(u => u.waitingForAcceptance == true).toArray
usersToAnswer = Users1x.getUsers(liveMeeting.users).filter(u => u.waitingForAcceptance == true).toArray
} else {
usersToAnswer = Users.getUsers(liveMeeting.users).filter(u => u.waitingForAcceptance == true && u.id == msg.userId).toArray
usersToAnswer = Users1x.getUsers(liveMeeting.users).filter(u => u.waitingForAcceptance == true && u.id == msg.userId).toArray
}
usersToAnswer foreach { user =>
println("UsersApp - handleGuestAccessDenied for user [" + user.id + "]");
if (msg.response == true) {
val nu = Users.setWaitingForAcceptance(user, liveMeeting.users, false)
val nu = Users1x.setWaitingForAcceptance(user, liveMeeting.users, false)
RegisteredUsers.updateRegUser(nu, liveMeeting.registeredUsers)
outGW.send(new UserJoined(props.meetingProp.intId, props.recordProp.record, nu))
} else {

View File

@ -0,0 +1,33 @@
package org.bigbluebutton.core.apps.caption
import akka.actor.ActorContext
import akka.event.Logging
import org.bigbluebutton.common2.msgs.TranscriptVO
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.running.LiveMeeting
class CaptionApp2x(val liveMeeting: LiveMeeting,
val outGW: OutMessageGateway)(implicit val context: ActorContext)
extends UserLeavingHdlr
with EditCaptionHistoryPubMsgHdlr
with UpdateCaptionOwnerPubMsgHdlr
with SendCaptionHistoryReqMsgHdlr {
val log = Logging(context.system, getClass)
def getCaptionHistory(): Map[String, TranscriptVO] = {
liveMeeting.captionModel.getHistory()
}
def updateCaptionOwner(locale: String, localeCode: String, userId: String): Map[String, TranscriptVO] = {
liveMeeting.captionModel.updateTranscriptOwner(locale, localeCode, userId)
}
def editCaptionHistory(userId: String, startIndex: Integer, endIndex: Integer, locale: String, text: String): Boolean = {
liveMeeting.captionModel.editHistory(userId, startIndex, endIndex, locale, text)
}
def checkCaptionOwnerLogOut(userId: String): Option[(String, TranscriptVO)] = {
liveMeeting.captionModel.checkCaptionOwnerLogOut(userId)
}
}

View File

@ -0,0 +1,31 @@
package org.bigbluebutton.core.apps.caption
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.msgs._
trait EditCaptionHistoryPubMsgHdlr {
this: CaptionApp2x =>
val outGW: OutMessageGateway
def handleEditCaptionHistoryPubMsg(msg: EditCaptionHistoryPubMsg): Unit = {
def broadcastEvent(msg: EditCaptionHistoryPubMsg): Unit = {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, msg.header.userId)
val envelope = BbbCoreEnvelope(EditCaptionHistoryEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(EditCaptionHistoryEvtMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId)
val body = EditCaptionHistoryEvtMsgBody(msg.body.startIndex, msg.body.endIndex, msg.body.locale, msg.body.localeCode, msg.body.text)
val event = EditCaptionHistoryEvtMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
outGW.send(msgEvent)
//record(event)
}
val successfulEdit = editCaptionHistory(msg.header.userId, msg.body.startIndex, msg.body.endIndex, msg.body.locale, msg.body.text)
if (successfulEdit) {
broadcastEvent(msg)
}
}
}

View File

@ -0,0 +1,28 @@
package org.bigbluebutton.core.apps.caption
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.msgs._
trait SendCaptionHistoryReqMsgHdlr {
this: CaptionApp2x =>
val outGW: OutMessageGateway
def handleSendCaptionHistoryReqMsg(msg: SendCaptionHistoryReqMsg): Unit = {
def broadcastEvent(msg: SendCaptionHistoryReqMsg, history: Map[String, TranscriptVO]): Unit = {
val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, liveMeeting.props.meetingProp.intId, msg.header.userId)
val envelope = BbbCoreEnvelope(SendCaptionHistoryRespMsg.NAME, routing)
val header = BbbClientMsgHeader(SendCaptionHistoryRespMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId)
val body = SendCaptionHistoryRespMsgBody(history)
val event = SendCaptionHistoryRespMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
outGW.send(msgEvent)
//record(event)
}
broadcastEvent(msg, getCaptionHistory())
}
}

View File

@ -0,0 +1,29 @@
package org.bigbluebutton.core.apps.caption
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.msgs._
trait UpdateCaptionOwnerPubMsgHdlr {
this: CaptionApp2x =>
val outGW: OutMessageGateway
def handleUpdateCaptionOwnerPubMsg(msg: UpdateCaptionOwnerPubMsg): Unit = {
updateCaptionOwner(msg.body.locale, msg.body.localeCode, msg.body.ownerId).foreach(f => {
broadcastUpdateCaptionOwnerEvent(f._1, f._2.localeCode, f._2.ownerId)
})
}
def broadcastUpdateCaptionOwnerEvent(locale: String, localeCode: String, newOwnerId: String): Unit = {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, newOwnerId)
val envelope = BbbCoreEnvelope(UpdateCaptionOwnerEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(UpdateCaptionOwnerEvtMsg.NAME, liveMeeting.props.meetingProp.intId, newOwnerId)
val body = UpdateCaptionOwnerEvtMsgBody(locale, localeCode, newOwnerId)
val event = UpdateCaptionOwnerEvtMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
outGW.send(msgEvent)
//record(event)
}
}

View File

@ -0,0 +1,19 @@
package org.bigbluebutton.core.apps.caption
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.running.MeetingActor
trait UserLeavingHdlr {
this: CaptionApp2x =>
val outGW: OutMessageGateway
def handleUserLeavingMsg(userId: String): Unit = {
for {
transcriptInfo <- checkCaptionOwnerLogOut(userId)
} yield {
broadcastUpdateCaptionOwnerEvent(transcriptInfo._1, transcriptInfo._2.localeCode, transcriptInfo._2.ownerId)
}
}
}

View File

@ -1,7 +1,7 @@
package org.bigbluebutton.core.apps.presentation
import org.bigbluebutton.core.api._
import org.bigbluebutton.core.models.{ RegisteredUsers, UserState, Users2x, VoiceUsers }
import org.bigbluebutton.core.models.{ UserState, Users2x }
trait EjectUserFromMeetingHdlr {
this: PresentationApp2x =>

View File

@ -1,8 +1,7 @@
package org.bigbluebutton.core.apps.presentation
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.messages.MessageBody.GetPresentationInfoRespMsgBody
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.common2.domain.PresentationVO
import org.bigbluebutton.core.apps.Presentation

View File

@ -1,8 +1,7 @@
package org.bigbluebutton.core.apps.presentation
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.messages.MessageBody.NewPresentationEvtMsgBody
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.common2.domain.PresentationVO
trait NewPresentationMsgHdlr {
@ -22,4 +21,4 @@ trait NewPresentationMsgHdlr {
//record(event)
}
}
}

View File

@ -1,9 +1,8 @@
package org.bigbluebutton.core.apps.presentation
import org.bigbluebutton.common2.domain.PageVO
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.messages.MessageBody.PresentationConversionCompletedEvtMsgBody
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.core.apps.Presentation
trait PresentationConversionCompletedPubMsgHdlr {

View File

@ -1,8 +1,7 @@
package org.bigbluebutton.core.apps.presentation
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.messages.MessageBody.PresentationConversionUpdateEvtMsgBody
import org.bigbluebutton.common2.messages._
trait PresentationConversionUpdatePubMsgHdlr {
this: PresentationApp2x =>
@ -26,4 +25,4 @@ trait PresentationConversionUpdatePubMsgHdlr {
broadcastEvent(msg)
}
}
}

View File

@ -1,8 +1,7 @@
package org.bigbluebutton.core.apps.presentation
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.messages.MessageBody.PresentationPageCountErrorEvtMsgBody
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.msgs._
trait PresentationPageCountErrorPubMsgHdlr {
this: PresentationApp2x =>
@ -26,4 +25,4 @@ trait PresentationPageCountErrorPubMsgHdlr {
broadcastEvent(msg)
}
}
}

View File

@ -1,8 +1,7 @@
package org.bigbluebutton.core.apps.presentation
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.messages.MessageBody.PresentationPageGeneratedEvtMsgBody
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.msgs._
trait PresentationPageGeneratedPubMsgHdlr {
this: PresentationApp2x =>
@ -26,4 +25,4 @@ trait PresentationPageGeneratedPubMsgHdlr {
broadcastEvent(msg)
}
}
}

View File

@ -1,8 +1,8 @@
package org.bigbluebutton.core.apps.presentation
import org.bigbluebutton.common2.domain.PageVO
import org.bigbluebutton.common2.msgs.PreuploadedPresentationsPubMsg
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.core.apps.Presentation
trait PreuploadedPresentationsPubMsgHdlr {

View File

@ -1,8 +1,7 @@
package org.bigbluebutton.core.apps.presentation
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.messages.MessageBody.RemovePresentationEvtMsgBody
import org.bigbluebutton.common2.messages._
trait RemovePresentationPubMsgHdlr {
this: PresentationApp2x =>
@ -30,4 +29,4 @@ trait RemovePresentationPubMsgHdlr {
broadcastEvent(msg)
}
}
}
}

View File

@ -1,8 +1,7 @@
package org.bigbluebutton.core.apps.presentation
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.messages.MessageBody.ResizeAndMovePageEvtMsgBody
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.common2.domain.PageVO
trait ResizeAndMovePagePubMsgHdlr {
@ -31,4 +30,4 @@ trait ResizeAndMovePagePubMsgHdlr {
broadcastEvent(msg, page)
}
}
}
}

View File

@ -1,8 +1,7 @@
package org.bigbluebutton.core.apps.presentation
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.messages.MessageBody.SetCurrentPageEvtMsgBody
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.msgs._
trait SetCurrentPagePubMsgHdlr {
this: PresentationApp2x =>
@ -28,4 +27,4 @@ trait SetCurrentPagePubMsgHdlr {
broadcastEvent(msg)
}
}
}
}

View File

@ -1,8 +1,7 @@
package org.bigbluebutton.core.apps.presentation
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.messages.MessageBody.SetCurrentPresentationEvtMsgBody
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.msgs._
trait SetCurrentPresentationPubMsgHdlr {
this: PresentationApp2x =>
@ -30,4 +29,4 @@ trait SetCurrentPresentationPubMsgHdlr {
broadcastEvent(msg)
}
}
}
}

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core.bus
import akka.actor.ActorRef
import akka.event.{ EventBus, LookupClassification }
import org.bigbluebutton.common2.messages.BbbCommonEnvCoreMsg
import org.bigbluebutton.common2.msgs.BbbCommonEnvCoreMsg
case class BbbMsgEvent(val topic: String, val payload: BbbCommonEnvCoreMsg)

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core.bus
import akka.actor.ActorRef
import akka.event.{ EventBus, LookupClassification }
import org.bigbluebutton.common2.messages.{ BbbCommonEnvCoreMsg }
import org.bigbluebutton.common2.msgs.{ BbbCommonEnvCoreMsg }
case class BbbOutMessage(val topic: String, val payload: BbbCommonEnvCoreMsg)

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core.bus
import akka.actor.ActorRef
import akka.event.{ EventBus, LookupClassification }
import org.bigbluebutton.common2.messages.{ BbbCoreMsg }
import org.bigbluebutton.common2.msgs.{ BbbCoreMsg }
case class BbbRecordMessage(val topic: String, val payload: BbbCoreMsg)

View File

@ -1,6 +1,6 @@
package org.bigbluebutton.core.models
import org.bigbluebutton.common2.messages.breakoutrooms.{ BreakoutRoomVO, BreakoutUserVO }
import org.bigbluebutton.common2.msgs.{ BreakoutRoomVO, BreakoutUserVO }
object BreakoutRooms {

View File

@ -15,11 +15,22 @@ object GuestsWaiting {
def remove(guests: GuestsWaiting, intId: String): Option[GuestWaiting] = {
guests.remove(intId)
}
def getGuestPolicy(guest: GuestsWaiting): GuestPolicy = {
guest.guestPolicy
}
def setGuestPolicy(guests: GuestsWaiting, policy: GuestPolicy): Unit = {
guests.setGuestPolicy(policy)
}
}
class GuestsWaiting {
private var guests: collection.immutable.HashMap[String, GuestWaiting] = new collection.immutable.HashMap[String, GuestWaiting]
private var guestPolicy = GuestPolicy(GuestPolicyType.ASK_MODERATOR, "SYSTEM")
private def toVector: Vector[GuestWaiting] = guests.values.toVector
private def save(user: GuestWaiting): GuestWaiting = {
@ -35,6 +46,16 @@ class GuestsWaiting {
user
}
}
def getGuestPolicy(): GuestPolicy = guestPolicy
def setGuestPolicy(policy: GuestPolicy) = guestPolicy = policy
}
case class GuestWaiting(intId: String, name: String, role: String)
case class GuestWaiting(intId: String, name: String, role: String)
case class GuestPolicy(policy: String, setBy: String)
object GuestPolicyType {
val ALWAYS_ACCEPT = "ALWAYS_ACCEPT"
val ALWAYS_DENY = "ALWAYS_DENY"
val ASK_MODERATOR = "ASK_MODERATOR"
}

View File

@ -1,8 +1,7 @@
package org.bigbluebutton.core.models
import java.util.ArrayList
import com.google.gson.Gson
import org.bigbluebutton.common2.domain._
import org.bigbluebutton.core.apps.WhiteboardKeyUtil
import scala.collection.mutable.ArrayBuffer
import scala.collection.mutable.HashMap
@ -25,7 +24,7 @@ object Polls {
page <- lm.presModel.getCurrentPage()
pageId: String = if (pollId.contains("deskshare")) "deskshare" else page.id
stampedPollId: String = pageId + "/" + System.currentTimeMillis()
numRespondents: Int = Users.numUsers(lm.users) - 1 // subtract the presenter
numRespondents: Int = Users1x.numUsers(lm.users) - 1 // subtract the presenter
poll <- createPoll(stampedPollId, numRespondents)
simplePoll <- getSimplePoll(poll.id, lm.polls)
@ -45,22 +44,30 @@ object Polls {
}
}
def handleShowPollResultReqMsg(requesterId: String, pollId: String, lm: LiveMeeting): Option[SimplePollResultOutVO] = {
// def send(poll: SimplePollResultOutVO, shape: scala.collection.immutable.Map[String, Object]): Unit = {
// for {
// page <- lm.presModel.getCurrentPage()
// pageId = if (poll.id.contains("deskshare")) "deskshare" else page.id
// annotation = new AnnotationVO(poll.id, WhiteboardKeyUtil.DRAW_END_STATUS, WhiteboardKeyUtil.POLL_RESULT_TYPE, shape, pageId, requesterId, -1)
// } handleSendWhiteboardAnnotationRequest(new SendWhiteboardAnnotationRequest(props.meetingProp.intId, requesterId, annotation))
// }
def handleShowPollResultReqMsg(requesterId: String, pollId: String, lm: LiveMeeting): Option[(SimplePollResultOutVO, AnnotationVO)] = {
def sendWhiteboardAnnotation(annotation: AnnotationVO): Unit = {
lm.wbModel.updateAnnotation(annotation.wbId, annotation.userId, annotation)
annotation
}
def send(poll: SimplePollResultOutVO, shape: scala.collection.immutable.Map[String, Object]): Option[AnnotationVO] = {
for {
page <- lm.presModel.getCurrentPage()
pageId = if (poll.id.contains("deskshare")) "deskshare" else page.id
annotation = new AnnotationVO(poll.id, WhiteboardKeyUtil.DRAW_END_STATUS, WhiteboardKeyUtil.POLL_RESULT_TYPE, shape, pageId, requesterId, -1)
} yield {
sendWhiteboardAnnotation(annotation)
annotation
}
}
for {
result <- getSimplePollResult(pollId, lm.polls)
shape = pollResultToWhiteboardShape(result)
annot <- send(result, shape)
} yield {
// send(result, shape)
showPollResult(pollId, lm.polls)
result
(result, annot)
}
}
@ -97,11 +104,11 @@ object Polls {
lm: LiveMeeting): Option[(String, String, SimplePollResultOutVO)] = {
for {
curPres <- Users.getCurrentPresenter(lm.users)
curPres <- Users2x.findPresenter(lm.users2x)
poll <- getSimplePollResult(pollId, lm.polls)
pvo <- handleRespondToPoll(poll, requesterId, pollId, questionId, answerId, lm)
} yield {
(curPres.id, pollId, pvo)
(curPres.intId, pollId, pvo)
}
}
@ -122,7 +129,7 @@ object Polls {
page <- lm.presModel.getCurrentPage()
pageId: String = if (pollId.contains("deskshare")) "deskshare" else page.id
stampedPollId: String = pageId + "/" + System.currentTimeMillis()
numRespondents: Int = Users.numUsers(lm.users) - 1 // subtract the presenter
numRespondents: Int = Users1x.numUsers(lm.users) - 1 // subtract the presenter
poll <- createPoll(stampedPollId, numRespondents)
simplePoll <- getSimplePoll(stampedPollId, lm.polls)
} yield {
@ -153,8 +160,8 @@ object Polls {
}
for {
user <- Users.findWithId(requesterId, lm.users)
responder = new Responder(user.id, user.name)
user <- Users2x.findWithIntId(lm.users2x, requesterId)
responder = new Responder(user.intId, user.name)
updatedPoll <- storePollResult(responder)
} yield {
updatedPoll
@ -164,34 +171,25 @@ object Polls {
private def pollResultToWhiteboardShape(result: SimplePollResultOutVO): scala.collection.immutable.Map[String, Object] = {
val shape = new scala.collection.mutable.HashMap[String, Object]()
shape += "num_respondents" -> new Integer(result.numRespondents)
shape += "num_responders" -> new Integer(result.numResponders)
shape += "type" -> "poll_result"
shape += "numRespondents" -> new Integer(result.numRespondents)
shape += "numResponders" -> new Integer(result.numResponders)
shape += "type" -> WhiteboardKeyUtil.POLL_RESULT_TYPE
shape += "id" -> result.id
shape += "status" -> "DRAW_END"
shape += "status" -> WhiteboardKeyUtil.DRAW_END_STATUS
val answers = new ArrayBuffer[java.util.HashMap[String, Object]]
var answers = new ArrayBuffer[SimpleVoteOutVO]
result.answers.foreach(ans => {
val amap = new java.util.HashMap[String, Object]()
amap.put("id", ans.id: java.lang.Integer)
amap.put("key", ans.key)
amap.put("num_votes", ans.numVotes: java.lang.Integer)
answers += amap
answers += SimpleVoteOutVO(ans.id, ans.key, ans.numVotes)
})
val gson = new Gson()
shape += "result" -> gson.toJson(answers.toArray)
shape += "result" -> answers
// Hardcode poll result display location for now to display result
// in bottom-right corner.
val display = new ArrayList[Double]()
val shapeHeight = 6.66 * answers.size
display.add(66.0)
display.add(100 - shapeHeight)
display.add(34.0)
display.add(shapeHeight)
val mapA = List(66.toFloat, 100 - shapeHeight, 34.toFloat, shapeHeight)
shape += "points" -> display
shape += "points" -> mapA
shape.toMap
}

View File

@ -19,10 +19,10 @@ object Roles {
val GUEST_ROLE = "GUEST"
}
object Users {
object Users1x {
def newUser(userId: String, lockStatus: Boolean, ru: RegisteredUser, waitingForAcceptance: Boolean,
vu: VoiceUserVO, users: Users): Option[UserVO] = {
vu: VoiceUserVO, users: Users1x): Option[UserVO] = {
val uvo = new UserVO(userId, ru.externId, ru.name,
ru.role, ru.guest, ru.authed, waitingForAcceptance = waitingForAcceptance, emojiStatus = "none", presenter = false,
hasStream = false, locked = lockStatus,
@ -32,69 +32,69 @@ object Users {
Some(uvo)
}
def findWithId(id: String, users: Users): Option[UserVO] = users.toVector.find(u => u.id == id)
def findWithExtId(id: String, users: Users): Option[UserVO] = users.toVector.find(u => u.externalId == id)
def findModerators(users: Users): Vector[UserVO] = users.toVector.filter(u => u.role == Roles.MODERATOR_ROLE)
def findPresenters(users: Users): Vector[UserVO] = users.toVector.filter(u => u.role == Roles.PRESENTER_ROLE)
def findViewers(users: Users): Vector[UserVO] = users.toVector.filter(u => u.role == Roles.VIEWER_ROLE)
def hasModerator(users: Users): Boolean = users.toVector.filter(u => u.role == Roles.MODERATOR_ROLE).length > 0
def hasPresenter(users: Users): Boolean = users.toVector.filter(u => u.role == Roles.PRESENTER_ROLE).length > 0
def hasNoPresenter(users: Users): Boolean = users.toVector.filter(u => u.role == Roles.PRESENTER_ROLE).length == 0
def findWithId(id: String, users: Users1x): Option[UserVO] = users.toVector.find(u => u.id == id)
def findWithExtId(id: String, users: Users1x): Option[UserVO] = users.toVector.find(u => u.externalId == id)
def findModerators(users: Users1x): Vector[UserVO] = users.toVector.filter(u => u.role == Roles.MODERATOR_ROLE)
def findPresenters(users: Users1x): Vector[UserVO] = users.toVector.filter(u => u.role == Roles.PRESENTER_ROLE)
def findViewers(users: Users1x): Vector[UserVO] = users.toVector.filter(u => u.role == Roles.VIEWER_ROLE)
def hasModerator(users: Users1x): Boolean = users.toVector.filter(u => u.role == Roles.MODERATOR_ROLE).length > 0
def hasPresenter(users: Users1x): Boolean = users.toVector.filter(u => u.role == Roles.PRESENTER_ROLE).length > 0
def hasNoPresenter(users: Users1x): Boolean = users.toVector.filter(u => u.role == Roles.PRESENTER_ROLE).length == 0
//def hasSessionId(sessionId: String, users: Users): Boolean = {
// users.toVector.find(u => usessionId)
// }
def hasUserWithId(id: String, users: Users): Boolean = {
def hasUserWithId(id: String, users: Users1x): Boolean = {
findWithId(id, users) match {
case Some(u) => true
case None => false
}
}
def numUsers(users: Users): Int = users.toVector.size
def numWebUsers(users: Users): Int = users.toVector filter (u => u.phoneUser == false) size
def numUsersInVoiceConference(users: Users): Int = users.toVector filter (u => u.voiceUser.joined) size
def getUserWithExternalId(id: String, users: Users): Option[UserVO] = users.toVector find (u => u.externalId == id)
def getUserWithVoiceUserId(voiceUserId: String, users: Users): Option[UserVO] = users.toVector find (u => u.voiceUser.userId == voiceUserId)
def getUser(userID: String, users: Users): Option[UserVO] = users.toVector find (u => u.id == userID)
def numModerators(users: Users): Int = findModerators(users).length
def findAModerator(users: Users): Option[UserVO] = users.toVector find (u => u.role == Roles.MODERATOR_ROLE)
def getCurrentPresenter(users: Users): Option[UserVO] = users.toVector find (u => u.presenter == true)
def numUsers(users: Users1x): Int = users.toVector.size
def numWebUsers(users: Users1x): Int = users.toVector filter (u => u.phoneUser == false) size
def numUsersInVoiceConference(users: Users1x): Int = users.toVector filter (u => u.voiceUser.joined) size
def getUserWithExternalId(id: String, users: Users1x): Option[UserVO] = users.toVector find (u => u.externalId == id)
def getUserWithVoiceUserId(voiceUserId: String, users: Users1x): Option[UserVO] = users.toVector find (u => u.voiceUser.userId == voiceUserId)
def getUser(userID: String, users: Users1x): Option[UserVO] = users.toVector find (u => u.id == userID)
def numModerators(users: Users1x): Int = findModerators(users).length
def findAModerator(users: Users1x): Option[UserVO] = users.toVector find (u => u.role == Roles.MODERATOR_ROLE)
def getCurrentPresenter(users: Users1x): Option[UserVO] = users.toVector find (u => u.presenter == true)
def getUsers(users: Users): Vector[UserVO] = users.toVector
def getUsers(users: Users1x): Vector[UserVO] = users.toVector
def userLeft(userId: String, users: Users): Option[UserVO] = {
def userLeft(userId: String, users: Users1x): Option[UserVO] = {
users.remove(userId)
}
def unbecomePresenter(userID: String, users: Users) = {
def unbecomePresenter(userID: String, users: Users1x) = {
for {
u <- Users.findWithId(userID, users)
u <- Users1x.findWithId(userID, users)
user = modify(u)(_.presenter).setTo(false)
} yield users.save(user)
}
def becomePresenter(userID: String, users: Users) = {
def becomePresenter(userID: String, users: Users1x) = {
for {
u <- Users.findWithId(userID, users)
u <- Users1x.findWithId(userID, users)
user = modify(u)(_.presenter).setTo(true)
} yield users.save(user)
}
def isModerator(id: String, users: Users): Boolean = {
Users.findWithId(id, users) match {
def isModerator(id: String, users: Users1x): Boolean = {
Users1x.findWithId(id, users) match {
case Some(user) => return user.role == Roles.MODERATOR_ROLE && !user.waitingForAcceptance
case None => return false
}
}
def generateWebUserId(users: Users): String = {
def generateWebUserId(users: Users1x): String = {
val webUserId = RandomStringGenerator.randomAlphanumericString(6)
if (!hasUserWithId(webUserId, users)) webUserId else generateWebUserId(users)
}
def usersWhoAreNotPresenter(users: Users): Vector[UserVO] = users.toVector filter (u => u.presenter == false)
def usersWhoAreNotPresenter(users: Users1x): Vector[UserVO] = users.toVector filter (u => u.presenter == false)
def joinedVoiceListenOnly(userId: String, users: Users): Option[UserVO] = {
def joinedVoiceListenOnly(userId: String, users: Users1x): Option[UserVO] = {
for {
u <- Users.findWithId(userId, users)
u <- Users1x.findWithId(userId, users)
vu = u.modify(_.voiceUser.joined).setTo(false)
.modify(_.voiceUser.talking).setTo(false)
.modify(_.listenOnly).setTo(true)
@ -104,9 +104,9 @@ object Users {
}
}
def leftVoiceListenOnly(userId: String, users: Users): Option[UserVO] = {
def leftVoiceListenOnly(userId: String, users: Users1x): Option[UserVO] = {
for {
u <- Users.findWithId(userId, users)
u <- Users1x.findWithId(userId, users)
vu = u.modify(_.voiceUser.joined).setTo(false)
.modify(_.voiceUser.talking).setTo(false)
.modify(_.listenOnly).setTo(false)
@ -116,7 +116,7 @@ object Users {
}
}
def lockUser(userId: String, lock: Boolean, users: Users): Option[UserVO] = {
def lockUser(userId: String, lock: Boolean, users: Users1x): Option[UserVO] = {
for {
u <- findWithId(userId, users)
uvo = u.modify(_.locked).setTo(lock) // u.copy(locked = msg.lock)
@ -126,7 +126,7 @@ object Users {
}
}
def changeRole(userId: String, users: Users, role: String): Option[UserVO] = {
def changeRole(userId: String, users: Users1x, role: String): Option[UserVO] = {
for {
u <- findWithId(userId, users)
uvo = u.modify(_.role).setTo(role)
@ -136,7 +136,7 @@ object Users {
}
}
def userSharedWebcam(userId: String, users: Users, streamId: String): Option[UserVO] = {
def userSharedWebcam(userId: String, users: Users1x, streamId: String): Option[UserVO] = {
for {
u <- findWithId(userId, users)
streams = u.webcamStreams + streamId
@ -147,7 +147,7 @@ object Users {
}
}
def userUnsharedWebcam(userId: String, users: Users, streamId: String): Option[UserVO] = {
def userUnsharedWebcam(userId: String, users: Users1x, streamId: String): Option[UserVO] = {
def findWebcamStream(streams: Set[String], stream: String): Option[String] = {
streams find (w => w == stream)
@ -164,7 +164,7 @@ object Users {
}
}
def setEmojiStatus(userId: String, users: Users, emoji: String): Option[UserVO] = {
def setEmojiStatus(userId: String, users: Users1x, emoji: String): Option[UserVO] = {
for {
u <- findWithId(userId, users)
uvo = u.modify(_.emojiStatus).setTo(emoji)
@ -174,26 +174,26 @@ object Users {
}
}
def setWaitingForAcceptance(user: UserVO, users: Users, waitingForAcceptance: Boolean): UserVO = {
def setWaitingForAcceptance(user: UserVO, users: Users1x, waitingForAcceptance: Boolean): UserVO = {
val nu = user.modify(_.waitingForAcceptance).setTo(waitingForAcceptance)
users.save(nu)
nu
}
def setUserTalking(user: UserVO, users: Users, talking: Boolean): UserVO = {
def setUserTalking(user: UserVO, users: Users1x, talking: Boolean): UserVO = {
val nv = user.modify(_.voiceUser.talking).setTo(talking)
users.save(nv)
nv
}
def setUserMuted(user: UserVO, users: Users, muted: Boolean): UserVO = {
def setUserMuted(user: UserVO, users: Users1x, muted: Boolean): UserVO = {
val talking: Boolean = if (muted) false else user.voiceUser.talking
val nv = user.modify(_.voiceUser.muted).setTo(muted).modify(_.voiceUser.talking).setTo(talking)
users.save(nv)
nv
}
def resetVoiceUser(user: UserVO, users: Users): UserVO = {
def resetVoiceUser(user: UserVO, users: Users1x): UserVO = {
val vu = new VoiceUserVO(user.id, user.id, user.name, user.name,
joined = false, locked = false, muted = false, talking = false, user.avatarURL, listenOnly = false)
@ -204,7 +204,7 @@ object Users {
nu
}
def switchUserToPhoneUser(user: UserVO, users: Users, voiceUserId: String, userId: String,
def switchUserToPhoneUser(user: UserVO, users: Users1x, voiceUserId: String, userId: String,
callerIdName: String, callerIdNum: String, muted: Boolean, talking: Boolean,
avatarURL: String, listenOnly: Boolean): UserVO = {
val vu = new VoiceUserVO(voiceUserId, userId, callerIdName,
@ -216,7 +216,7 @@ object Users {
nu
}
def restoreMuteState(user: UserVO, users: Users, voiceUserId: String, userId: String,
def restoreMuteState(user: UserVO, users: Users1x, voiceUserId: String, userId: String,
callerIdName: String, callerIdNum: String, muted: Boolean, talking: Boolean,
avatarURL: String, listenOnly: Boolean): UserVO = {
val vu = new VoiceUserVO(voiceUserId, userId, callerIdName,
@ -228,7 +228,7 @@ object Users {
nu
}
def makeUserPhoneUser(vu: VoiceUserVO, users: Users, webUserId: String, externUserId: String,
def makeUserPhoneUser(vu: VoiceUserVO, users: Users1x, webUserId: String, externUserId: String,
callerIdName: String, lockStatus: Boolean, listenOnly: Boolean, avatarURL: String): UserVO = {
val uvo = new UserVO(webUserId, externUserId, callerIdName,
Roles.VIEWER_ROLE, guest = false, authed = false, waitingForAcceptance = false, emojiStatus = "none", presenter = false,
@ -242,7 +242,7 @@ object Users {
}
class Users {
class Users1x {
private var users: collection.immutable.HashMap[String, UserVO] = new collection.immutable.HashMap[String, UserVO]
private def toVector: Vector[UserVO] = users.values.toVector

View File

@ -1,72 +0,0 @@
package org.bigbluebutton.core.models
import com.softwaremill.quicklens.modify
object UsersState {
def findWithIntId(users: UsersState, intId: String): Option[UserState] = users.toVector.find(u => u.intId == intId)
def findModerators(users: UsersState): Vector[UserState] = users.toVector.filter(u => u.role == Roles.MODERATOR_ROLE)
def findPresenters(users: UsersState): Vector[UserState] = users.toVector.filter(u => u.role == Roles.PRESENTER_ROLE)
def findViewers(users: UsersState): Vector[UserState] = users.toVector.filter(u => u.role == Roles.VIEWER_ROLE)
def hasModerator(users: UsersState): Boolean = users.toVector.filter(u => u.role == Roles.MODERATOR_ROLE).length > 0
def hasPresenter(users: UsersState): Boolean = users.toVector.filter(u => u.role == Roles.PRESENTER_ROLE).length > 0
def hasNoPresenter(users: UsersState): Boolean = users.toVector.filter(u => u.role == Roles.PRESENTER_ROLE).length == 0
def hasUserWithIntId(users: UsersState, intId: String): Boolean = {
findWithIntId(users, intId) match {
case Some(u) => true
case None => false
}
}
def numUsers(users: UsersState): Int = users.toVector.size
def usersWhoAreNotPresenter(users: UsersState): Vector[UserState] = users.toVector filter (u => u.presenter == false)
def unbecomePresenter(users: UsersState, intId: String) = {
for {
u <- findWithIntId(users, intId)
user = modify(u)(_.presenter).setTo(false)
} yield users.save(user)
}
def becomePresenter(users: UsersState, intId: String) = {
for {
u <- findWithIntId(users, intId)
user = modify(u)(_.presenter).setTo(true)
} yield users.save(user)
}
def isModerator(id: String, users: Users): Boolean = {
Users.findWithId(id, users) match {
case Some(user) => return user.role == Roles.MODERATOR_ROLE && !user.waitingForAcceptance
case None => return false
}
}
def add(users: UsersState, state: UserState): Option[UserState] = {
users.save(state)
Some(state)
}
def remove(users: UsersState, intId: String): Option[UserState] = {
users.remove(intId)
}
}
class UsersState {
private var usersStatus: collection.immutable.HashMap[String, UserState] = new collection.immutable.HashMap[String, UserState]
private def toVector: Vector[UserState] = usersStatus.values.toVector
private def save(user: UserState): UserState = {
usersStatus += user.intId -> user
user
}
private def remove(intId: String): Option[UserState] = {
val user = usersStatus.get(intId)
user foreach (u => usersStatus -= intId)
user
}
}

View File

@ -120,3 +120,6 @@ case class VoiceUser2x(intId: String, voiceUserId: String)
case class VoiceUserVO2x(intId: String, voiceUserId: String, callerName: String,
callerNum: String, joined: Boolean, locked: Boolean, muted: Boolean,
talking: Boolean, callingWith: String, listenOnly: Boolean)
case class VoiceUserState(intId: String, voiceUserId: String, callingWith: String, callerName: String,
callerNum: String, muted: Boolean, talking: Boolean, listenOnly: Boolean)

View File

@ -1,77 +0,0 @@
package org.bigbluebutton.core.models
import com.softwaremill.quicklens._
object VoiceUsersState {
def findWithId(users: VoiceUsersState, userId: String): Option[VoiceUserState] = users.toVector.find(u => u.intId == userId)
def add(users: VoiceUsersState, state: VoiceUserState): Option[VoiceUserState] = {
users.save(state)
Some(state)
}
def remove(users: VoiceUsersState, intId: String): Option[VoiceUserState] = {
users.remove(intId)
}
def joinedVoiceListenOnly(users: VoiceUsersState, userId: String): Option[VoiceUserState] = {
for {
u <- findWithId(users, userId)
vu = u.modify(_.talking).setTo(false)
.modify(_.listenOnly).setTo(true)
} yield {
users.save(vu)
vu
}
}
def leftVoiceListenOnly(users: VoiceUsersState, userId: String): Option[VoiceUserState] = {
for {
u <- findWithId(users, userId)
vu = u.modify(_.talking).setTo(false)
.modify(_.listenOnly).setTo(false)
} yield {
users.save(vu)
vu
}
}
def setUserTalking(users: VoiceUsersState, user: VoiceUserState, talking: Boolean): VoiceUserState = {
val nv = user.modify(_.talking).setTo(talking)
users.save(nv)
nv
}
def setUserMuted(users: VoiceUsersState, user: VoiceUserState, muted: Boolean): VoiceUserState = {
val talking: Boolean = if (muted) false else user.talking
val nv = user.modify(_.muted).setTo(muted).modify(_.talking).setTo(talking)
users.save(nv)
nv
}
}
class VoiceUsersState {
private var users: collection.immutable.HashMap[String, VoiceUserState] = new collection.immutable.HashMap[String, VoiceUserState]
private def toVector: Vector[VoiceUserState] = users.values.toVector
private def save(user: VoiceUserState): VoiceUserState = {
users += user.intId -> user
user
}
private def remove(intId: String): Option[VoiceUserState] = {
val user = users.get(intId)
user foreach (u => users -= intId)
user
}
}
object VoiceUserState {
def setTalking(user: VoiceUserState, talking: Boolean): VoiceUserState = {
user.modify(_.talking).setTo(talking)
}
}
case class VoiceUserState(intId: String, voiceUserId: String, callingWith: String, callerName: String,
callerNum: String, muted: Boolean, talking: Boolean, listenOnly: Boolean)

View File

@ -1,44 +0,0 @@
package org.bigbluebutton.core.pubsub.senders
import org.bigbluebutton.common.messages.Constants
import org.bigbluebutton.core.api._
import org.bigbluebutton.core.messaging.Util
import scala.collection.JavaConverters
object CaptionMessageToJsonConverter {
def sendCaptionHistoryReplyToJson(msg: SendCaptionHistoryReply): String = {
val payload = new java.util.HashMap[String, Any]()
payload.put(Constants.MEETING_ID, msg.meetingID)
payload.put(Constants.REQUESTER_ID, msg.requesterID)
payload.put(Constants.CAPTION_HISTORY, JavaConverters.mapAsJavaMap(msg.history))
val header = Util.buildHeader(MessageNames.SEND_CAPTION_HISTORY_REPLY, Some(msg.requesterID))
Util.buildJson(header, payload)
}
def updateCaptionOwnerReplyToJson(msg: UpdateCaptionOwnerReply): String = {
val payload = new java.util.HashMap[String, Any]()
payload.put(Constants.MEETING_ID, msg.meetingID)
payload.put(Constants.LOCALE, msg.locale)
payload.put(Constants.LOCALE_CODE, msg.localeCode)
payload.put(Constants.OWNER_ID, msg.ownerID)
val header = Util.buildHeader(MessageNames.UPDATE_CAPTION_OWNER, None)
Util.buildJson(header, payload)
}
def editCaptionHistoryReplyToJson(msg: EditCaptionHistoryReply): String = {
val payload = new java.util.HashMap[String, Any]()
payload.put(Constants.MEETING_ID, msg.meetingID)
payload.put(Constants.USER_ID, msg.userID)
payload.put(Constants.START_INDEX, msg.startIndex)
payload.put(Constants.END_INDEX, msg.endIndex)
payload.put(Constants.LOCALE, msg.locale)
payload.put(Constants.LOCALE_CODE, msg.localeCode)
payload.put(Constants.TEXT, msg.text)
val header = Util.buildHeader(MessageNames.EDIT_CAPTION_HISTORY, None)
Util.buildJson(header, payload)
}
}

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core.pubsub.senders
import com.fasterxml.jackson.databind.JsonNode
import org.bigbluebutton.SystemConfiguration
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.bus.BbbMsgEvent
import scala.reflect.runtime.universe._

View File

@ -3,13 +3,7 @@ package org.bigbluebutton.core.pubsub.senders
import akka.actor.{ Actor, ActorLogging, Props }
import org.bigbluebutton.SystemConfiguration
import com.fasterxml.jackson.databind.JsonNode
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.breakoutrooms._
import org.bigbluebutton.common2.messages.polls._
import org.bigbluebutton.common2.messages.users._
import org.bigbluebutton.common2.messages.layout._
import org.bigbluebutton.common2.messages.voiceconf._
import org.bigbluebutton.common2.messages.whiteboard._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.bus._
import org.bigbluebutton.core2.ReceivedMessageRouter
@ -278,7 +272,12 @@ class ReceivedJsonMsgHandlerActor(
routeGenericMsg[PresentationPageGeneratedPubMsg](envelope, jsonNode)
case PresentationConversionCompletedPubMsg.NAME =>
routeGenericMsg[PresentationConversionCompletedPubMsg](envelope, jsonNode)
case EditCaptionHistoryPubMsg.NAME =>
routeGenericMsg[EditCaptionHistoryPubMsg](envelope, jsonNode)
case UpdateCaptionOwnerPubMsg.NAME =>
routeGenericMsg[UpdateCaptionOwnerPubMsg](envelope, jsonNode)
case SendCaptionHistoryReqMsg.NAME =>
routeGenericMsg[SendCaptionHistoryReqMsg](envelope, jsonNode)
case _ =>
log.error("Cannot route envelope name " + envelope.name)
// do nothing

View File

@ -13,7 +13,7 @@ class LiveMeeting(val props: DefaultProps,
val chatModel: ChatModel,
val layoutModel: LayoutModel,
val layouts: Layouts,
val users: Users,
val users: Users1x,
val registeredUsers: RegisteredUsers,
val polls: Polls, // 2x
val pollModel: PollModel, // 1.1x
@ -33,13 +33,13 @@ class LiveMeeting(val props: DefaultProps,
}
def webUserJoined() {
if (Users.numWebUsers(users) > 0) {
if (Users1x.numWebUsers(users) > 0) {
MeetingStatus2x.resetLastWebUserLeftOn(status)
}
}
def startCheckingIfWeNeedToEndVoiceConf() {
if (Users.numWebUsers(users) == 0 && !props.meetingProp.isBreakout) {
if (Users1x.numWebUsers(users) == 0 && !props.meetingProp.isBreakout) {
MeetingStatus2x.lastWebUserLeft(status)
}
}

View File

@ -6,26 +6,20 @@ import akka.actor._
import akka.actor.ActorLogging
import akka.actor.SupervisorStrategy.Resume
import org.bigbluebutton.common2.domain.DefaultProps
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.breakoutrooms._
import org.bigbluebutton.common2.messages.polls._
import org.bigbluebutton.common2.messages.users._
import org.bigbluebutton.common2.messages.voiceconf.{ UserJoinedVoiceConfEvtMsg, UserLeftVoiceConfEvtMsg, UserMutedInVoiceConfEvtMsg, UserTalkingInVoiceConfEvtMsg }
import org.bigbluebutton.common2.messages.whiteboard._
import org.bigbluebutton.common2.messages.layout._
import org.bigbluebutton.core._
import org.bigbluebutton.core.api._
import org.bigbluebutton.core.apps._
import org.bigbluebutton.core.apps.caption.CaptionApp2x
import org.bigbluebutton.core.apps.deskshare.DeskshareApp2x
import org.bigbluebutton.core.apps.presentation.PresentationApp2x
import org.bigbluebutton.core.apps.presentation.poll.PollApp2x
import org.bigbluebutton.core.apps.users.UsersApp2x
import org.bigbluebutton.core.bus._
import org.bigbluebutton.core.models.{ RegisteredUsers, Users }
import org.bigbluebutton.core.models.{ RegisteredUsers, Users1x }
import org.bigbluebutton.core2.MeetingStatus2x
import org.bigbluebutton.core2.message.handlers._
import org.bigbluebutton.core2.message.handlers.users._
import org.bigbluebutton.common2.msgs._
import scala.concurrent.duration._
import org.bigbluebutton.core.models.BreakoutRooms
import org.bigbluebutton.core2.message.handlers.breakoutrooms._
@ -45,7 +39,7 @@ class MeetingActor(val props: DefaultProps,
extends Actor with ActorLogging
with UsersApp with PresentationApp
with LayoutApp with ChatApp with WhiteboardApp with PollApp
with BreakoutRoomApp with CaptionApp
with BreakoutRoomApp
with SharedNotesApp with PermisssionCheck
with UserBroadcastCamStartMsgHdlr
with UserJoinedVoiceConfEvtMsgHdlr
@ -109,6 +103,7 @@ class MeetingActor(val props: DefaultProps,
val presentationApp2x = new PresentationApp2x(liveMeeting, outGW = outGW)
val pollApp2x = new PollApp2x(liveMeeting, outGW = outGW)
val deskshareApp2x = new DeskshareApp2x(liveMeeting, outGW = outGW)
val captionApp2x = new CaptionApp2x(liveMeeting, outGW = outGW)
/*******************************************************************/
//object FakeTestData extends FakeTestData
@ -181,11 +176,6 @@ class MeetingActor(val props: DefaultProps,
case msg: SendTimeRemainingUpdate => handleSendTimeRemainingUpdate(msg)
case msg: EndMeeting => handleEndMeeting(msg)
// Closed Caption
case msg: SendCaptionHistoryRequest => handleSendCaptionHistoryRequest(msg)
case msg: UpdateCaptionOwnerRequest => handleUpdateCaptionOwnerRequest(msg)
case msg: EditCaptionHistoryRequest => handleEditCaptionHistoryRequest(msg)
case msg: DeskShareStartedRequest => handleDeskShareStartedRequest(msg)
case msg: DeskShareStoppedRequest => handleDeskShareStoppedRequest(msg)
case msg: DeskShareRTMPBroadcastStartedRequest => handleDeskShareRTMPBroadcastStartedRequest(msg)
@ -256,6 +246,9 @@ class MeetingActor(val props: DefaultProps,
case m: PresentationPageCountErrorPubMsg => presentationApp2x.handlePresentationPageCountErrorPubMsg(m)
case m: PresentationPageGeneratedPubMsg => presentationApp2x.handlePresentationPageGeneratedPubMsg(m)
case m: PresentationConversionCompletedPubMsg => presentationApp2x.handlePresentationConversionCompletedPubMsg(m)
case m: EditCaptionHistoryPubMsg => captionApp2x.handleEditCaptionHistoryPubMsg(m)
case m: UpdateCaptionOwnerPubMsg => captionApp2x.handleUpdateCaptionOwnerPubMsg(m)
case m: SendCaptionHistoryReqMsg => captionApp2x.handleSendCaptionHistoryReqMsg(m)
case _ => log.warning("***** Cannot handle " + msg.envelope.name)
}
}
@ -311,19 +304,19 @@ class MeetingActor(val props: DefaultProps,
}
def handleGetGuestPolicy(msg: GetGuestPolicy) {
outGW.send(new GetGuestPolicyReply(msg.meetingID, props.recordProp.record,
msg.requesterID, MeetingStatus2x.getGuestPolicy(liveMeeting.status).toString()))
// outGW.send(new GetGuestPolicyReply(msg.meetingID, props.recordProp.record,
// msg.requesterID, MeetingStatus2x.getGuestPolicy(liveMeeting.status).toString()))
}
def handleSetGuestPolicy(msg: SetGuestPolicy) {
MeetingStatus2x.setGuestPolicy(liveMeeting.status, msg.policy)
MeetingStatus2x.setGuestPolicySetBy(liveMeeting.status, msg.setBy)
outGW.send(new GuestPolicyChanged(msg.meetingID, props.recordProp.record,
MeetingStatus2x.getGuestPolicy(liveMeeting.status).toString()))
// MeetingStatus2x.setGuestPolicy(liveMeeting.status, msg.policy)
// MeetingStatus2x.setGuestPolicySetBy(liveMeeting.status, msg.setBy)
// outGW.send(new GuestPolicyChanged(msg.meetingID, props.recordProp.record,
// MeetingStatus2x.getGuestPolicy(liveMeeting.status).toString()))
}
def handleLogoutEndMeeting(msg: LogoutEndMeeting) {
if (Users.isModerator(msg.userID, liveMeeting.users)) {
if (Users1x.isModerator(msg.userID, liveMeeting.users)) {
handleEndMeeting(EndMeeting(props.meetingProp.intId))
}
}
@ -343,7 +336,7 @@ class MeetingActor(val props: DefaultProps,
}
def handleAllowUserToShareDesktop(msg: AllowUserToShareDesktop): Unit = {
Users.getCurrentPresenter(liveMeeting.users) match {
Users1x.getCurrentPresenter(liveMeeting.users) match {
case Some(curPres) => {
val allowed = msg.userID equals (curPres.id)
outGW.send(AllowUserToShareDesktopOut(msg.meetingID, msg.userID, allowed))
@ -434,7 +427,7 @@ class MeetingActor(val props: DefaultProps,
}
def monitorNumberOfWebUsers() {
if (Users.numWebUsers(liveMeeting.users) == 0 &&
if (Users1x.numWebUsers(liveMeeting.users) == 0 &&
MeetingStatus2x.lastWebUserLeftOn(liveMeeting.status) > 0) {
if (liveMeeting.timeNowInMinutes - MeetingStatus2x.lastWebUserLeftOn(liveMeeting.status) > 2) {
log.info("Empty meeting. Ejecting all users from voice. meetingId={}", props.meetingProp.intId)
@ -444,7 +437,7 @@ class MeetingActor(val props: DefaultProps,
}
def monitorNumberOfUsers() {
val hasUsers = Users.numUsers(liveMeeting.users) != 0
val hasUsers = Users1x.numUsers(liveMeeting.users) != 0
// TODO: We could use a better control over this message to send it just when it really matters :)
eventBus.publish(BigBlueButtonEvent(props.meetingProp.intId, UpdateMeetingExpireMonitor(props.meetingProp.intId, hasUsers)))
}
@ -477,7 +470,7 @@ class MeetingActor(val props: DefaultProps,
def startRecordingIfAutoStart() {
if (props.recordProp.record && !MeetingStatus2x.isRecording(liveMeeting.status) &&
props.recordProp.autoStartRecording && Users.numWebUsers(liveMeeting.users) == 1) {
props.recordProp.autoStartRecording && Users1x.numWebUsers(liveMeeting.users) == 1) {
log.info("Auto start recording. meetingId={}", props.meetingProp.intId)
MeetingStatus2x.recordingStarted(liveMeeting.status)
outGW.send(new RecordingStatusChanged(props.meetingProp.intId, props.recordProp.record,
@ -487,7 +480,7 @@ class MeetingActor(val props: DefaultProps,
def stopAutoStartedRecording() {
if (props.recordProp.record && MeetingStatus2x.isRecording(liveMeeting.status) &&
props.recordProp.autoStartRecording && Users.numWebUsers(liveMeeting.users) == 0) {
props.recordProp.autoStartRecording && Users1x.numWebUsers(liveMeeting.users) == 0) {
log.info("Last web user left. Auto stopping recording. meetingId={}", props.meetingProp.intId)
MeetingStatus2x.recordingStopped(liveMeeting.status)
outGW.send(new RecordingStatusChanged(props.meetingProp.intId, props.recordProp.record,

View File

@ -26,13 +26,12 @@ class RunningMeeting(val props: DefaultProps, val outGW: OutMessageGateway,
val breakoutRooms = new BreakoutRooms()
val captionModel = new CaptionModel()
val notesModel = new SharedNotesModel()
val users = new Users
val users = new Users1x
val registeredUsers = new RegisteredUsers
val meetingStatux2x = new MeetingStatus2x
val webcams = new Webcams
val voiceUsers = new VoiceUsers
val users2x = new Users2x
val usersState = new UsersState
val polls2x = new Polls
val guestsWaiting = new GuestsWaiting

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core2
import akka.actor.{ Actor, ActorLogging, Props }
import org.bigbluebutton.SystemConfiguration
import org.bigbluebutton.common2.messages.BbbCommonEnvCoreMsg
import org.bigbluebutton.common2.msgs.BbbCommonEnvCoreMsg
import org.bigbluebutton.common2.util.JsonUtil
import org.bigbluebutton.core.MessageSender

View File

@ -3,7 +3,7 @@ package org.bigbluebutton.core2
import java.util.concurrent.TimeUnit
import org.bigbluebutton.core.MeetingExtensionProp
import org.bigbluebutton.core.api.{ GuestPolicy, Permissions, Presenter }
import org.bigbluebutton.core.api.{ Permissions, Presenter }
object MeetingStatus2x {
def setCurrentPresenterInfo(status: MeetingStatus2x, pres: Presenter) {
@ -146,10 +146,6 @@ object MeetingStatus2x {
def hasMeetingEnded(status: MeetingStatus2x): Boolean = status.meetingEnded
def timeNowInMinutes(status: MeetingStatus2x): Long = TimeUnit.NANOSECONDS.toMinutes(System.nanoTime())
def timeNowInSeconds(status: MeetingStatus2x): Long = TimeUnit.NANOSECONDS.toSeconds(System.nanoTime())
def getGuestPolicy(status: MeetingStatus2x): GuestPolicy.GuestPolicy = status.guestPolicy
def setGuestPolicy(status: MeetingStatus2x, policy: GuestPolicy.GuestPolicy) = status.guestPolicy = policy
def getGuestPolicySetBy(status: MeetingStatus2x): String = status.guestPolicySetBy
def setGuestPolicySetBy(status: MeetingStatus2x, user: String) = status.guestPolicySetBy = user
def startedOn(status: MeetingStatus2x): Long = status.startedOn
@ -177,8 +173,6 @@ class MeetingStatus2x {
private var muted = false
private var meetingEnded = false
private var meetingMuted = false
private var guestPolicy = GuestPolicy.ASK_MODERATOR
private var guestPolicySetBy: String = null
private var hasLastWebUserLeft = false
private var lastWebUserLeftOnTimestamp: Long = 0
@ -332,8 +326,4 @@ class MeetingStatus2x {
private def meetingHasEnded() = meetingEnded = true
private def hasMeetingEnded(): Boolean = meetingEnded
private def getGuestPolicy(): GuestPolicy.GuestPolicy = guestPolicy
private def setGuestPolicy(policy: GuestPolicy.GuestPolicy) = guestPolicy = policy
private def getGuestPolicySetBy(): String = guestPolicySetBy
private def setGuestPolicySetBy(user: String) = guestPolicySetBy = user
}

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core2.message.handlers
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.{ EjectUserFromVoiceRequest, EjectVoiceUser }
import org.bigbluebutton.core.models.Users
import org.bigbluebutton.core.models.Users1x
import org.bigbluebutton.core.running.MeetingActor
trait EjectUserFromVoiceRequestHdlr {
@ -14,7 +14,7 @@ trait EjectUserFromVoiceRequestHdlr {
log.info("Received eject user request. meetingId=" + msg.meetingID + " userId=" + msg.userId)
for {
u <- Users.findWithId(msg.userId, liveMeeting.users)
u <- Users1x.findWithId(msg.userId, liveMeeting.users)
} yield {
if (u.voiceUser.joined) {
log.info("Ejecting user from voice. meetingId=" + props.meetingProp.intId + " userId=" + u.id)

View File

@ -1,11 +1,10 @@
package org.bigbluebutton.core2.message.handlers
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.Polls
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.common2.domain.PollVO
import org.bigbluebutton.common2.messages.polls.{ GetCurrentPollReqMsg, GetCurrentPollRespMsg, GetCurrentPollRespMsgBody }
trait GetCurrentPollReqMsgHdlr {
this: MeetingActor =>

View File

@ -1,7 +1,6 @@
package org.bigbluebutton.core2.message.handlers
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.polls.{ HidePollResultReqMsg, PollHideResultEvtMsg, PollHideResultEvtMsgBody }
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.Polls
import org.bigbluebutton.core.running.MeetingActor

View File

@ -1,7 +1,6 @@
package org.bigbluebutton.core2.message.handlers
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.voiceconf.{ MuteUserInVoiceConfMsg, MuteUserInVoiceConfMsgBody }
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.{ MeetingMuted, MuteAllExceptPresenterRequest, MuteVoiceUser }
import org.bigbluebutton.core.models.{ Users2x, VoiceUserState, VoiceUsers }

View File

@ -1,10 +1,9 @@
package org.bigbluebutton.core2.message.handlers
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.voiceconf.{ MuteUserInVoiceConfMsg, MuteUserInVoiceConfMsgBody }
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.{ MeetingMuted, MuteMeetingRequest, MuteVoiceUser }
import org.bigbluebutton.core.models.{ Users, VoiceUserState, VoiceUsers }
import org.bigbluebutton.core.models.{ Users1x, VoiceUserState, VoiceUsers }
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core2.MeetingStatus2x
@ -23,7 +22,7 @@ trait MuteMeetingRequestHdlr {
outGW.send(new MeetingMuted(props.meetingProp.intId, props.recordProp.record,
MeetingStatus2x.isMeetingMuted(liveMeeting.status)))
Users.getUsers(liveMeeting.users) foreach { u =>
Users1x.getUsers(liveMeeting.users) foreach { u =>
outGW.send(new MuteVoiceUser(props.meetingProp.intId, props.recordProp.record, msg.requesterID,
u.id, props.voiceProp.voiceConf, u.voiceUser.userId, msg.mute))
}

View File

@ -1,8 +1,7 @@
package org.bigbluebutton.core2.message.handlers
import org.bigbluebutton.common2.domain.SimplePollResultOutVO
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.polls.{ RespondToPollReqMsg, UserRespondedToPollEvtMsg, UserRespondedToPollEvtMsgBody }
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.Polls
import org.bigbluebutton.core.running.MeetingActor
@ -13,6 +12,7 @@ trait RespondToPollReqMsgHdlr {
val outGW: OutMessageGateway
def handleRespondToPollReqMsg(msg: RespondToPollReqMsg): Unit = {
log.debug("Received RespondToPollReqMsg {}", RespondToPollReqMsg)
def broadcastEvent(msg: RespondToPollReqMsg, stoppedPollId: String, presenterId: String, poll: SimplePollResultOutVO): Unit = {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, props.meetingProp.intId, msg.header.userId)

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core2.message.handlers
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.{ NewPermissionsSetting, SetLockSettings }
import org.bigbluebutton.core.models.Users
import org.bigbluebutton.core.models.Users1x
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core2.MeetingStatus2x

View File

@ -1,11 +1,10 @@
package org.bigbluebutton.core2.message.handlers
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.Polls
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.common2.domain.SimplePollResultOutVO
import org.bigbluebutton.common2.messages.polls.{ PollShowResultEvtMsg, PollShowResultEvtMsgBody, ShowPollResultReqMsg }
import org.bigbluebutton.common2.domain.{ AnnotationVO, SimplePollResultOutVO }
trait ShowPollResultReqMsgHdlr {
this: MeetingActor =>
@ -14,7 +13,8 @@ trait ShowPollResultReqMsgHdlr {
def handleShowPollResultReqMsg(msg: ShowPollResultReqMsg): Unit = {
def broadcastEvent(msg: ShowPollResultReqMsg, result: SimplePollResultOutVO): Unit = {
def broadcastEvent(msg: ShowPollResultReqMsg, result: SimplePollResultOutVO, annot: AnnotationVO): Unit = {
// PollShowResultEvtMsg
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, props.meetingProp.intId, msg.header.userId)
val envelope = BbbCoreEnvelope(PollShowResultEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(PollShowResultEvtMsg.NAME, props.meetingProp.intId, msg.header.userId)
@ -23,12 +23,23 @@ trait ShowPollResultReqMsgHdlr {
val event = PollShowResultEvtMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
outGW.send(msgEvent)
// SendWhiteboardAnnotationPubMsg
val annotationRouting = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, props.meetingProp.intId, msg.header.userId)
val annotationEnvelope = BbbCoreEnvelope(SendWhiteboardAnnotationEvtMsg.NAME, annotationRouting)
val annotationHeader = BbbClientMsgHeader(SendWhiteboardAnnotationEvtMsg.NAME, props.meetingProp.intId, msg.header.userId)
val annotMsgBody = SendWhiteboardAnnotationEvtMsgBody(annot)
val annotationEvent = SendWhiteboardAnnotationEvtMsg(annotationHeader, annotMsgBody)
val annotationMsgEvent = BbbCommonEnvCoreMsg(annotationEnvelope, annotationEvent)
outGW.send(annotationMsgEvent)
}
for {
result <- Polls.handleShowPollResultReqMsg(msg.header.userId, msg.body.pollId, liveMeeting)
(result, annotationProp) <- Polls.handleShowPollResultReqMsg(msg.header.userId, msg.body.pollId, liveMeeting)
} yield {
broadcastEvent(msg, result)
broadcastEvent(msg, result, annotationProp)
}
}
}

View File

@ -1,8 +1,7 @@
package org.bigbluebutton.core2.message.handlers
import org.bigbluebutton.common2.domain.SimplePollOutVO
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.polls.{ PollStartedEvtMsg, PollStartedEvtMsgBody, StartCustomPollReqMsg }
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.Polls
import org.bigbluebutton.core.running.MeetingActor

View File

@ -1,8 +1,7 @@
package org.bigbluebutton.core2.message.handlers
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.common2.domain.SimplePollOutVO
import org.bigbluebutton.common2.messages.polls.{ PollStartedEvtMsg, PollStartedEvtMsgBody, StartPollReqMsg }
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.Polls
import org.bigbluebutton.core.running.MeetingActor

View File

@ -1,7 +1,6 @@
package org.bigbluebutton.core2.message.handlers
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.polls.{ PollStoppedEvtMsg, PollStoppedEvtMsgBody, StopPollReqMsg }
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.Polls
import org.bigbluebutton.core.running.MeetingActor

View File

@ -1,7 +1,6 @@
package org.bigbluebutton.core2.message.handlers.breakoutrooms
import org.bigbluebutton.common2.messages.BbbClientMsgHeader
import org.bigbluebutton.common2.messages.breakoutrooms._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.BreakoutRooms
import org.bigbluebutton.core.running.MeetingActor
@ -31,7 +30,8 @@ trait BreakoutRoomCreatedMsgHdlr {
}
}
handleBreakoutRoomsListMsg(new BreakoutRoomsListMsg(new BbbClientMsgHeader(BreakoutRoomsListMsg.NAME, msg.header.meetingId, msg.header.userId), new BreakoutRoomsListMsgBody(props.meetingProp.intId)))
handleBreakoutRoomsListMsg(new BreakoutRoomsListMsg(new BbbClientMsgHeader(BreakoutRoomsListMsg.NAME,
msg.header.meetingId, msg.header.userId), new BreakoutRoomsListMsgBody(props.meetingProp.intId)))
}
}
}
}

View File

@ -1,9 +1,6 @@
package org.bigbluebutton.core2.message.handlers.breakoutrooms
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.MessageTypes
import org.bigbluebutton.common2.messages.Routing
import org.bigbluebutton.common2.messages.breakoutrooms._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.BreakoutRooms
import org.bigbluebutton.core.running.MeetingActor

View File

@ -1,9 +1,6 @@
package org.bigbluebutton.core2.message.handlers.breakoutrooms
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.MessageTypes
import org.bigbluebutton.common2.messages.Routing
import org.bigbluebutton.common2.messages.breakoutrooms._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.BreakoutRooms
import org.bigbluebutton.core.running.MeetingActor

View File

@ -1,7 +1,6 @@
package org.bigbluebutton.core2.message.handlers.breakoutrooms
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.breakoutrooms._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core.models.BreakoutRooms

View File

@ -1,6 +1,6 @@
package org.bigbluebutton.core2.message.handlers.breakoutrooms
import org.bigbluebutton.common2.messages.breakoutrooms.CreateBreakoutRoomsMsg
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.BreakoutRoomOutPayload
import org.bigbluebutton.core.api.CreateBreakoutRoom

View File

@ -1,12 +1,9 @@
package org.bigbluebutton.core2.message.handlers.breakoutrooms
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.MessageTypes
import org.bigbluebutton.common2.messages.Routing
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.BreakoutRooms
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.common2.messages.breakoutrooms._
trait EndAllBreakoutRoomsMsgHdlr {
this: MeetingActor =>

View File

@ -1,12 +1,11 @@
package org.bigbluebutton.core2.message.handlers.breakoutrooms
import org.bigbluebutton.core.models.Users
import org.bigbluebutton.core.models.Users1x
import org.bigbluebutton.core.models.BreakoutRooms
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.apps.BreakoutRoomsUtil
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.common2.messages.breakoutrooms._
trait RequestBreakoutJoinURLMsgHdlr {
this: MeetingActor =>
@ -24,7 +23,7 @@ trait RequestBreakoutJoinURLMsgHdlr {
def sendJoinURL(userId: String, externalMeetingId: String, roomSequence: String) {
log.debug("Sending breakout meeting {} Join URL for user: {}", externalMeetingId, userId)
for {
user <- Users.findWithId(userId, liveMeeting.users)
user <- Users1x.findWithId(userId, liveMeeting.users)
apiCall = "join"
params = BreakoutRoomsUtil.joinParams(user.name, userId + "-" + roomSequence, true,
externalMeetingId, props.password.moderatorPass)

View File

@ -1,11 +1,10 @@
package org.bigbluebutton.core2.message.handlers.breakoutrooms
import org.bigbluebutton.common2.messages.breakoutrooms.BreakoutUserVO
import org.bigbluebutton.common2.messages.breakoutrooms.SendBreakoutUsersUpdateMsg
import org.bigbluebutton.common2.msgs.{ BreakoutUserVO, SendBreakoutUsersUpdateMsg }
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.BreakoutRoomUsersUpdate
import org.bigbluebutton.core.bus.BigBlueButtonEvent
import org.bigbluebutton.core.models.Users
import org.bigbluebutton.core.models.Users1x
import org.bigbluebutton.core.running.MeetingActor
trait SendBreakoutUsersUpdateMsgHdlr {
@ -15,7 +14,7 @@ trait SendBreakoutUsersUpdateMsgHdlr {
def handleSendBreakoutUsersUpdateMsg(msg: SendBreakoutUsersUpdateMsg): Unit = {
val users = Users.getUsers(liveMeeting.users)
val users = Users1x.getUsers(liveMeeting.users)
val breakoutUsers = users map { u => new BreakoutUserVO(u.externalId, u.name) }
eventBus.publish(BigBlueButtonEvent(props.breakoutProps.parentId,
new BreakoutRoomUsersUpdate(props.breakoutProps.parentId, props.meetingProp.intId, breakoutUsers)))

View File

@ -1,10 +1,9 @@
package org.bigbluebutton.core2.message.handlers.breakoutrooms
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.breakoutrooms._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.BreakoutRooms
import org.bigbluebutton.core.models.Users
import org.bigbluebutton.core.models.Users1x
import org.bigbluebutton.core.running.MeetingActor
trait TransferUserToMeetingRequestHdlr {
@ -29,7 +28,7 @@ trait TransferUserToMeetingRequestHdlr {
targetVoiceBridge = props.voiceProp.voiceConf.dropRight(1)
}
// We check the user from the mode
Users.findWithId(msg.body.userId, liveMeeting.users) match {
Users1x.findWithId(msg.body.userId, liveMeeting.users) match {
case Some(u) => {
if (u.voiceUser.joined) {
log.info("Transferring user userId=" + u.id + " from voiceBridge=" + props.voiceProp.voiceConf + " to targetVoiceConf=" + targetVoiceBridge)
@ -51,4 +50,4 @@ trait TransferUserToMeetingRequestHdlr {
broadcastEvent(msg)
}
}
}

View File

@ -1,8 +1,6 @@
package org.bigbluebutton.core2.message.handlers.layout
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.Routing
import org.bigbluebutton.common2.messages.layout._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.Layouts
import org.bigbluebutton.core.running.MeetingActor

View File

@ -1,16 +1,10 @@
package org.bigbluebutton.core2.message.handlers.layout
import org.bigbluebutton.common2.messages.Routing
import org.bigbluebutton.common2.messages.MessageTypes
import org.bigbluebutton.common2.messages.layout._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.common2.messages.BbbCommonEnvCoreMsg
import org.bigbluebutton.core2.MeetingStatus2x
import org.bigbluebutton.common2.messages.layout.GetCurrentLayoutMsg
import org.bigbluebutton.common2.messages.BbbClientMsgHeader
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.Layouts
import org.bigbluebutton.common2.messages.BbbCoreEnvelope
trait GetCurrentLayoutMsgHdlr {
this: MeetingActor =>

View File

@ -1,8 +1,6 @@
package org.bigbluebutton.core2.message.handlers.layout
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.Routing
import org.bigbluebutton.common2.messages.layout._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.Layouts
import org.bigbluebutton.core.running.MeetingActor
@ -56,4 +54,4 @@ trait LockLayoutMsgHdlr {
broadcastEvent(msg)
}
}
}

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.{ GetLockSettings, NewPermissionsSetting }
import org.bigbluebutton.core.models.Users
import org.bigbluebutton.core.models.Users1x
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core2.MeetingStatus2x

View File

@ -1,11 +1,8 @@
package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.core.{ OutMessageGateway }
import org.bigbluebutton.core.api.GetUsers
import org.bigbluebutton.core.models.Users2x
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core2.message.senders.{ GetUsersMeetingRespMsgBuilder, Sender }
trait GetUsersHdlr {
this: MeetingActor =>

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.{ InitLockSettings, PermissionsSettingInitialized }
import org.bigbluebutton.core.models.Users
import org.bigbluebutton.core.models.Users1x
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core2.MeetingStatus2x

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.{ LockUserRequest, UserLocked }
import org.bigbluebutton.core.models.Users
import org.bigbluebutton.core.models.Users1x
import org.bigbluebutton.core.running.MeetingActor
trait LockUserRequestHdlr {
@ -12,7 +12,7 @@ trait LockUserRequestHdlr {
def handleLockUserRequest(msg: LockUserRequest) {
for {
uvo <- Users.lockUser(msg.userID, msg.lock, liveMeeting.users)
uvo <- Users1x.lockUser(msg.userID, msg.lock, liveMeeting.users)
} yield {
log.info("Lock user. meetingId=" + props.meetingProp.intId + " userId=" + uvo.id + " locked=" + uvo.locked)
outGW.send(new UserLocked(props.meetingProp.intId, uvo.id, uvo.locked))

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.{ MuteUserRequest, MuteVoiceUser }
import org.bigbluebutton.core.models.{ Users, Users2x, VoiceUsers }
import org.bigbluebutton.core.models.{ Users1x, Users2x, VoiceUsers }
import org.bigbluebutton.core.running.MeetingActor
trait MuteUserRequestHdlr {

View File

@ -1,7 +1,6 @@
package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.users.{ UserBroadcastCamStartMsg, UserBroadcastCamStartedEvtMsg, UserBroadcastCamStartedEvtMsgBody }
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.{ MediaStream, WebcamStream, Webcams }
import org.bigbluebutton.core.running.MeetingActor

View File

@ -1,7 +1,6 @@
package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.users.{ UserBroadcastCamStopMsg, UserBroadcastCamStoppedEvtMsg, UserBroadcastCamStoppedEvtMsgBody }
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.Webcams
import org.bigbluebutton.core.running.MeetingActor

View File

@ -1,12 +1,10 @@
package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.voiceconf.{ UserJoinedVoiceConfToClientEvtMsg, UserJoinedVoiceConfToClientEvtMsgBody }
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.{ UserConnectedToGlobalAudio, UserListeningOnly }
import org.bigbluebutton.core.models.{ Users, Users2x, VoiceUserState, VoiceUsers }
import org.bigbluebutton.core.api.UserConnectedToGlobalAudio
import org.bigbluebutton.core.models.{ Users2x, VoiceUserState, VoiceUsers }
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core2.MeetingStatus2x
trait UserConnectedToGlobalAudioHdlr {
this: MeetingActor =>

View File

@ -1,7 +1,6 @@
package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.voiceconf.{ UserLeftVoiceConfToClientEvtMsg, UserLeftVoiceConfToClientEvtMsgBody }
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.{ UserDisconnectedFromGlobalAudio, UserLeft, UserListeningOnly }
import org.bigbluebutton.core.models.{ VoiceUserState, VoiceUsers }

View File

@ -1,10 +1,9 @@
package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.common2.messages.users.{ UserEmojiChangedEvtMsg, UserEmojiChangedEvtMsgBody, ValidateAuthTokenRespMsg, ValidateAuthTokenRespMsgBody }
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.{ UserChangedEmojiStatus, UserEmojiStatus }
import org.bigbluebutton.core.models.{ Users, Users2x }
import org.bigbluebutton.core.models.{ Users1x, Users2x }
import org.bigbluebutton.core.running.MeetingActor
trait UserEmojiStatusHdlr {

View File

@ -1,6 +1,6 @@
package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.common2.messages.users.UserJoinMeetingReqMsg
import org.bigbluebutton.common2.msgs.UserJoinMeetingReqMsg
import org.bigbluebutton.core.{ MessageRecorder, OutMessageGateway }
import org.bigbluebutton.core.models.{ RegisteredUsers, UserState, Users2x }
import org.bigbluebutton.core.running.MeetingActor

View File

@ -1,7 +1,6 @@
package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.voiceconf.{ UserJoinedVoiceConfEvtMsg, UserJoinedVoiceConfToClientEvtMsg, UserJoinedVoiceConfToClientEvtMsgBody }
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.{ VoiceUser2x, VoiceUserState, VoiceUsers }
import org.bigbluebutton.core.running.MeetingActor

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api._
import org.bigbluebutton.core.models.{ Roles, Users }
import org.bigbluebutton.core.models.{ Roles, Users1x }
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core2.MeetingStatus2x
import org.bigbluebutton.common2.domain.VoiceUserVO

View File

@ -1,7 +1,6 @@
package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.users.UserLeaveReqMsg
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.Users2x
import org.bigbluebutton.core.running.MeetingActor
@ -17,7 +16,7 @@ trait UserLeavingHdlr {
} yield {
log.info("User left meeting. meetingId=" + props.meetingProp.intId + " userId=" + u.intId + " user=" + u)
checkCaptionOwnerLogOut(u.intId)
captionApp2x.handleUserLeavingMsg(msg.body.userId)
liveMeeting.startCheckingIfWeNeedToEndVoiceConf()
stopAutoStartedRecording()
sendUserLeftMeetingEvtMsg(outGW, props.meetingProp.intId, msg.body.userId)

View File

@ -1,7 +1,6 @@
package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.voiceconf.{ UserLeftVoiceConfEvtMsg, UserLeftVoiceConfToClientEvtMsg, UserLeftVoiceConfToClientEvtMsgBody }
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.{ VoiceUserState, VoiceUsers }
import org.bigbluebutton.core.running.MeetingActor

View File

@ -1,7 +1,6 @@
package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.voiceconf._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.{ VoiceUserState, VoiceUsers }
import org.bigbluebutton.core.running.MeetingActor

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.{ UserShareWebcam, UserSharedWebcam }
import org.bigbluebutton.core.models.Users
import org.bigbluebutton.core.models.Users1x
import org.bigbluebutton.core.running.MeetingActor
trait UserShareWebcamHdlr {
@ -12,7 +12,7 @@ trait UserShareWebcamHdlr {
def handleUserShareWebcam(msg: UserShareWebcam) {
for {
uvo <- Users.userSharedWebcam(msg.userId, liveMeeting.users, msg.stream)
uvo <- Users1x.userSharedWebcam(msg.userId, liveMeeting.users, msg.stream)
} yield {
log.info("User shared webcam. meetingId=" + props.meetingProp.intId + " userId=" + uvo.id + " stream=" + msg.stream)
outGW.send(new UserSharedWebcam(props.meetingProp.intId, props.recordProp.record, uvo.id, msg.stream))

View File

@ -1,7 +1,6 @@
package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.voiceconf._
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models.{ VoiceUserState, VoiceUsers }
import org.bigbluebutton.core.running.MeetingActor

View File

@ -2,7 +2,7 @@ package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.{ UserUnshareWebcam, UserUnsharedWebcam }
import org.bigbluebutton.core.models.Users
import org.bigbluebutton.core.models.Users1x
import org.bigbluebutton.core.running.MeetingActor
trait UserUnshareWebcamHdlr {
@ -12,7 +12,7 @@ trait UserUnshareWebcamHdlr {
def handleUserunshareWebcam(msg: UserUnshareWebcam) {
for {
uvo <- Users.userUnsharedWebcam(msg.userId, liveMeeting.users, msg.stream)
uvo <- Users1x.userUnsharedWebcam(msg.userId, liveMeeting.users, msg.stream)
} yield {
log.info("User unshared webcam. meetingId=" + props.meetingProp.intId + " userId=" + uvo.id + " stream=" + msg.stream)
outGW.send(new UserUnsharedWebcam(props.meetingProp.intId, props.recordProp.record, uvo.id, msg.stream))

View File

@ -1,12 +1,9 @@
package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.users.ValidateAuthTokenReqMsg
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.models._
import org.bigbluebutton.core.api.{ GuestPolicy, ValidateAuthToken }
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core2.MeetingStatus2x
import org.bigbluebutton.core2.message.senders._
trait ValidateAuthTokenReqMsgHdlr {
@ -20,7 +17,7 @@ trait ValidateAuthTokenReqMsgHdlr {
RegisteredUsers.getRegisteredUserWithToken(msg.body.authToken, msg.body.userId, liveMeeting.registeredUsers) match {
case Some(u) =>
if (u.guest && u.waitingForAcceptance && MeetingStatus2x.getGuestPolicy(liveMeeting.status) == GuestPolicy.ASK_MODERATOR) {
if (u.guest && u.waitingForAcceptance && GuestsWaiting.getGuestPolicy(liveMeeting.guestsWaiting).policy == GuestPolicyType.ASK_MODERATOR) {
ValidateAuthTokenRespMsgSender.send(outGW, meetingId = props.meetingProp.intId,
userId = msg.body.userId, authToken = msg.body.authToken, valid = true, waitForApproval = true)
@ -89,7 +86,7 @@ trait ValidateAuthTokenReqMsgHdlr {
}
def sendAllWebcamStreams(requesterId: String): Unit = {
val streams = Webcams.findAll(liveMeeting.webcams)
val streams = org.bigbluebutton.core.models.Webcams.findAll(liveMeeting.webcams)
val webcamStreams = streams.map { u =>
val msVO = MediaStreamVO(id = u.stream.id, url = u.stream.url, userId = u.stream.userId,
attributes = u.stream.attributes, viewers = u.stream.viewers)

View File

@ -2,8 +2,7 @@ package org.bigbluebutton.core2.message.handlers.whiteboard
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.whiteboard.{ ClearWhiteboardEvtMsg, ClearWhiteboardEvtMsgBody, ClearWhiteboardPubMsg }
import org.bigbluebutton.common2.msgs._
trait ClearWhiteboardPubMsgHdlr {
this: MeetingActor =>

View File

@ -2,8 +2,7 @@ package org.bigbluebutton.core2.message.handlers.whiteboard
import org.bigbluebutton.core.running.MeetingActor
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.common2.messages._
import org.bigbluebutton.common2.messages.whiteboard.{ GetWhiteboardAccessReqMsg, GetWhiteboardAccessRespMsg, GetWhiteboardAccessRespMsgBody }
import org.bigbluebutton.common2.msgs._
trait GetWhiteboardAccessReqMsgHdlr {
this: MeetingActor =>
@ -27,4 +26,4 @@ trait GetWhiteboardAccessReqMsgHdlr {
broadcastEvent(msg, getWhiteboardAccess())
}
}
}

Some files were not shown because too many files have changed in this diff Show More