- only remove stream if present

This commit is contained in:
Richard Alam 2015-07-14 14:22:17 +00:00
parent 007a13d0e9
commit 10ef6bec01

View File

@ -249,12 +249,15 @@ trait UsersApp {
def handleUserunshareWebcam(msg: UserUnshareWebcam) {
usersModel.getUser(msg.userId) foreach { user =>
val streams = user.webcamStreams - msg.stream
val streamName = user.webcamStreams find (w => w == msg.stream) foreach { streamName =>
val streams = user.webcamStreams - streamName
val uvo = user.copy(hasStream = (!streams.isEmpty), webcamStreams = streams)
usersModel.addUser(uvo)
log.info("User unshared webcam: mid=[" + mProps.meetingID + "] uid=[" + uvo.userID + "] unsharedStream=[" + msg.stream + "] streams=[" + streams + "]")
outGW.send(new UserUnsharedWebcam(mProps.meetingID, mProps.recorded, uvo.userID, msg.stream))
}
}
}
def handleChangeUserStatus(msg: ChangeUserStatus): Unit = {