- look for all pods where the user was the presenter

This commit is contained in:
Richard Alam 2017-11-30 13:10:37 -08:00
parent 0a2610ab18
commit fdf075e7df
2 changed files with 7 additions and 7 deletions

View File

@ -39,8 +39,8 @@ object PresentationPodsApp {
PresentationPodVO(pod.id, pod.currentPresenter, presentationVOs)
}
def findPodWhereUserIsPresenter(mgr: PresentationPodManager, userId: String): Option[PresentationPod] = {
mgr.presentationPods.values.toVector.find(p => p.currentPresenter == userId)
def findPodsWhereUserIsPresenter(mgr: PresentationPodManager, userId: String): Vector[PresentationPod] = {
mgr.presentationPods.values.toVector.filter(p => p.currentPresenter == userId)
}
def updatePresentationPod(state: MeetingState2x, pod: PresentationPod): MeetingState2x = {

View File

@ -64,17 +64,17 @@ trait UserLeaveReqMsgHdlr {
Users2x.removeUserFromPresenterGroup(liveMeeting.users2x, u.intId)
outGW.send(buildRemoveUserFromPresenterGroup(liveMeeting.props.meetingProp.intId, u.intId, u.intId))
for {
pod <- PresentationPodsApp.findPodWhereUserIsPresenter(state.presentationPodManager, u.intId)
} yield {
val pods = PresentationPodsApp.findPodsWhereUserIsPresenter(state.presentationPodManager, u.intId)
pods foreach { pod =>
val presenters = Users2x.getPresenterGroupUsers(liveMeeting.users2x)
if (presenters.length > 0) {
val updatedPod = pod.setCurrentPresenter(presenters.head)
broadcastSetPresenterInPodRespMsg(pod.id, presenters.head, presenters.head)
val pods = state.presentationPodManager.addPod(updatedPod)
newState = state.update(pods)
val newpods = state.presentationPodManager.addPod(updatedPod)
newState = state.update(newpods)
}
}
}