forked from bigbluebutton/bigbluebutton
-
Notifications
You must be signed in to change notification settings - Fork 0
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 bigbluebutton#5975 from riadvice/user-typing-feature
Implementation of user typing feature to chat
- Loading branch information
Showing
15 changed files
with
328 additions
and
144 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
21 changes: 21 additions & 0 deletions
21
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/chat/UserTypingPubMsgHdlr.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,21 @@ | ||
package org.bigbluebutton.core.apps.chat | ||
|
||
import org.bigbluebutton.common2.msgs._ | ||
import org.bigbluebutton.core.bus.MessageBus | ||
import org.bigbluebutton.core.running.{ LiveMeeting, LogHelper } | ||
|
||
trait UserTypingPubMsgHdlr extends LogHelper { | ||
def handle(msg: UserTypingPubMsg, liveMeeting: LiveMeeting, bus: MessageBus): Unit = { | ||
def broadcastEvent(msg: UserTypingPubMsg): Unit = { | ||
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, msg.header.userId) | ||
val envelope = BbbCoreEnvelope(UserTypingEvtMsg.NAME, routing) | ||
val header = BbbClientMsgHeader(UserTypingEvtMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId) | ||
|
||
val body = UserTypingEvtMsgBody(msg.body.chatId, msg.header.userId) | ||
val event = UserTypingEvtMsg(header, body) | ||
val msgEvent = BbbCommonEnvCoreMsg(envelope, event) | ||
bus.outGW.send(msgEvent) | ||
} | ||
broadcastEvent(msg) | ||
} | ||
} |
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
21 changes: 12 additions & 9 deletions
21
bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/ChatMessages.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 |
---|---|---|
@@ -1,39 +1,42 @@ | ||
package org.bigbluebutton.common2.msgs | ||
|
||
|
||
/* In Messages */ | ||
object GetChatHistoryReqMsg { val NAME = "GetChatHistoryReqMsg"} | ||
object GetChatHistoryReqMsg { val NAME = "GetChatHistoryReqMsg" } | ||
case class GetChatHistoryReqMsg(header: BbbClientMsgHeader, body: GetChatHistoryReqMsgBody) extends StandardMsg | ||
case class GetChatHistoryReqMsgBody() | ||
|
||
object SendPublicMessagePubMsg { val NAME = "SendPublicMessagePubMsg"} | ||
object SendPublicMessagePubMsg { val NAME = "SendPublicMessagePubMsg" } | ||
case class SendPublicMessagePubMsg(header: BbbClientMsgHeader, body: SendPublicMessagePubMsgBody) extends StandardMsg | ||
case class SendPublicMessagePubMsgBody(message: ChatMessageVO) | ||
|
||
object SendPrivateMessagePubMsg { val NAME = "SendPrivateMessagePubMsg"} | ||
object SendPrivateMessagePubMsg { val NAME = "SendPrivateMessagePubMsg" } | ||
case class SendPrivateMessagePubMsg(header: BbbClientMsgHeader, body: SendPrivateMessagePubMsgBody) extends StandardMsg | ||
case class SendPrivateMessagePubMsgBody(message: ChatMessageVO) | ||
|
||
object ClearPublicChatHistoryPubMsg { val NAME = "ClearPublicChatHistoryPubMsg"} | ||
object ClearPublicChatHistoryPubMsg { val NAME = "ClearPublicChatHistoryPubMsg" } | ||
case class ClearPublicChatHistoryPubMsg(header: BbbClientMsgHeader, body: ClearPublicChatHistoryPubMsgBody) extends StandardMsg | ||
case class ClearPublicChatHistoryPubMsgBody(chatId: String) | ||
|
||
/* Out Messages */ | ||
object GetChatHistoryRespMsg { val NAME = "GetChatHistoryRespMsg"} | ||
object GetChatHistoryRespMsg { val NAME = "GetChatHistoryRespMsg" } | ||
case class GetChatHistoryRespMsg(header: BbbClientMsgHeader, body: GetChatHistoryRespMsgBody) extends StandardMsg | ||
case class GetChatHistoryRespMsgBody(history: Array[ChatMessageVO]) | ||
|
||
object SendPublicMessageEvtMsg { val NAME = "SendPublicMessageEvtMsg"} | ||
object SendPublicMessageEvtMsg { val NAME = "SendPublicMessageEvtMsg" } | ||
case class SendPublicMessageEvtMsg(header: BbbClientMsgHeader, body: SendPublicMessageEvtMsgBody) extends StandardMsg | ||
case class SendPublicMessageEvtMsgBody(message: ChatMessageVO) | ||
|
||
object SendPrivateMessageEvtMsg { val NAME = "SendPrivateMessageEvtMsg"} | ||
object SendPrivateMessageEvtMsg { val NAME = "SendPrivateMessageEvtMsg" } | ||
case class SendPrivateMessageEvtMsg(header: BbbClientMsgHeader, body: SendPrivateMessageEvtMsgBody) extends StandardMsg | ||
case class SendPrivateMessageEvtMsgBody(message: ChatMessageVO) | ||
|
||
object ClearPublicChatHistoryEvtMsg { val NAME = "ClearPublicChatHistoryEvtMsg"} | ||
object ClearPublicChatHistoryEvtMsg { val NAME = "ClearPublicChatHistoryEvtMsg" } | ||
case class ClearPublicChatHistoryEvtMsg(header: BbbClientMsgHeader, body: ClearPublicChatHistoryEvtMsgBody) extends StandardMsg | ||
case class ClearPublicChatHistoryEvtMsgBody(chatId: String) | ||
|
||
object UserTypingEvtMsg { val NAME = "UserTypingEvtMsg" } | ||
case class UserTypingEvtMsg(header: BbbClientMsgHeader, body: UserTypingEvtMsgBody) extends StandardMsg | ||
case class UserTypingEvtMsgBody(chatId: String, userId: String) | ||
|
||
case class ChatMessageVO(fromUserId: String, fromUsername: String, fromColor: String, fromTime: Long, fromTimezoneOffset: Int, | ||
toUserId: String, toUsername: String, message: String) |
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.