-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11366 from MaximKhlobystov/updating-poll-ui
Updated poll UI: question field and typed responses
- Loading branch information
Showing
26 changed files
with
952 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...-apps/src/main/scala/org/bigbluebutton/core/apps/polls/RespondToTypedPollReqMsgHdlr.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package org.bigbluebutton.core.apps.polls | ||
|
||
import org.bigbluebutton.common2.domain.SimplePollResultOutVO | ||
import org.bigbluebutton.common2.msgs._ | ||
import org.bigbluebutton.core.bus.MessageBus | ||
import org.bigbluebutton.core.models.Polls | ||
import org.bigbluebutton.core.running.{ LiveMeeting } | ||
import org.bigbluebutton.core.models.Users2x | ||
|
||
trait RespondToTypedPollReqMsgHdlr { | ||
this: PollApp2x => | ||
|
||
def handle(msg: RespondToTypedPollReqMsg, liveMeeting: LiveMeeting, bus: MessageBus): Unit = { | ||
log.debug("Received RespondToPollReqMsg {}", RespondToTypedPollReqMsg) | ||
|
||
def broadcastPollUpdatedEvent(msg: RespondToTypedPollReqMsg, pollId: String, poll: SimplePollResultOutVO): Unit = { | ||
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, msg.header.userId) | ||
val envelope = BbbCoreEnvelope(PollUpdatedEvtMsg.NAME, routing) | ||
val header = BbbClientMsgHeader(PollUpdatedEvtMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId) | ||
|
||
val body = PollUpdatedEvtMsgBody(pollId, poll) | ||
val event = PollUpdatedEvtMsg(header, body) | ||
val msgEvent = BbbCommonEnvCoreMsg(envelope, event) | ||
bus.outGW.send(msgEvent) | ||
} | ||
|
||
def broadcastUserRespondedToTypedPollRespMsg(msg: RespondToTypedPollReqMsg, pollId: String, answer: String, sendToId: String): Unit = { | ||
val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, liveMeeting.props.meetingProp.intId, sendToId) | ||
val envelope = BbbCoreEnvelope(UserRespondedToTypedPollRespMsg.NAME, routing) | ||
val header = BbbClientMsgHeader(UserRespondedToTypedPollRespMsg.NAME, liveMeeting.props.meetingProp.intId, sendToId) | ||
|
||
val body = UserRespondedToTypedPollRespMsgBody(pollId, msg.header.userId, answer) | ||
val event = UserRespondedToTypedPollRespMsg(header, body) | ||
val msgEvent = BbbCommonEnvCoreMsg(envelope, event) | ||
bus.outGW.send(msgEvent) | ||
} | ||
|
||
for { | ||
(pollId: String, updatedPoll: SimplePollResultOutVO) <- Polls.handleRespondToTypedPollReqMsg(msg.header.userId, msg.body.pollId, | ||
msg.body.questionId, msg.body.answer, liveMeeting) | ||
} yield { | ||
broadcastPollUpdatedEvent(msg, pollId, updatedPoll) | ||
|
||
for { | ||
presenter <- Users2x.findPresenter(liveMeeting.users2x) | ||
} yield { | ||
broadcastUserRespondedToTypedPollRespMsg(msg, pollId, msg.body.answer, presenter.intId) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.