[issue-14243] - Changes in Akka, to save the events in redis, and changes in rap to process these changes.

This commit is contained in:
Guilherme Leme 2022-02-17 17:23:28 -03:00
parent 0e47fe4912
commit f6e144d71c
4 changed files with 9 additions and 0 deletions

View File

@ -28,6 +28,10 @@ class PublicChatRecordEvent extends AbstractChatRecordEvent {
eventMap.put(SENDERID, senderId) eventMap.put(SENDERID, senderId)
} }
def setSenderRole(senderRole: String): Unit = {
eventMap.put(SENDER_ROLE, senderRole)
}
def setMessage(message: String) { def setMessage(message: String) {
eventMap.put(MESSAGE, message) eventMap.put(MESSAGE, message)
} }
@ -36,4 +40,5 @@ class PublicChatRecordEvent extends AbstractChatRecordEvent {
object PublicChatRecordEvent { object PublicChatRecordEvent {
private final val SENDERID = "senderId" private final val SENDERID = "senderId"
private final val MESSAGE = "message" private final val MESSAGE = "message"
private final val SENDER_ROLE = "senderRole"
} }

View File

@ -139,6 +139,7 @@ class RedisRecorderActor(
ev.setMeetingId(msg.header.meetingId) ev.setMeetingId(msg.header.meetingId)
ev.setSenderId(msg.body.msg.sender.id) ev.setSenderId(msg.body.msg.sender.id)
ev.setMessage(msg.body.msg.message) ev.setMessage(msg.body.msg.message)
ev.setSenderRole(msg.body.msg.sender.role)
record(msg.header.meetingId, ev.toMap.asJava) record(msg.header.meetingId, ev.toMap.asJava)
} }

View File

@ -579,12 +579,14 @@ module BigBlueButton
date = event.at_xpath('./date')&.content date = event.at_xpath('./date')&.content
date = DateTime.iso8601(date) unless date.nil? date = DateTime.iso8601(date) unless date.nil?
sender_id = event.at_xpath('./senderId')&.content sender_id = event.at_xpath('./senderId')&.content
senderRole = event.at_xpath('./senderRole')&.content
chats << { chats << {
in: timestamp - offset, in: timestamp - offset,
out: nil, out: nil,
sender_id: sender_id, sender_id: sender_id,
sender: user_map.fetch(sender_id), sender: user_map.fetch(sender_id),
senderRole: senderRole,
message: linkify(event.at_xpath('./message').content.strip), message: linkify(event.at_xpath('./message').content.strip),
date: date, date: date,
} }

View File

@ -1076,6 +1076,7 @@ def processChatMessages(events, bbb_props)
in: (chat[:in] / 1000.0).round(1), in: (chat[:in] / 1000.0).round(1),
direction: 'down', direction: 'down',
name: chat[:sender], name: chat[:sender],
senderRole: chat[:senderRole],
message: chat[:message], message: chat[:message],
target: 'chat' target: 'chat'
} }