diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala index 4e8c836ced..c39730832a 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala @@ -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 = { diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserLeaveReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserLeaveReqMsgHdlr.scala index 64835b6ef1..fed82476e8 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserLeaveReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserLeaveReqMsgHdlr.scala @@ -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) } } }