feat(akka): join param to flag user as bot

Introduces new join parameter `bot` to flag users as bot.
This commit is contained in:
Arthurk12 2024-10-16 12:30:02 -03:00
parent a52586f217
commit 86ea21e52b
26 changed files with 88 additions and 47 deletions

View File

@ -59,8 +59,8 @@ trait RegisterUserReqMsgHdlr {
val regUser = RegisteredUsers.create(liveMeeting.props.meetingProp.intId, msg.body.intUserId, msg.body.extUserId, val regUser = RegisteredUsers.create(liveMeeting.props.meetingProp.intId, msg.body.intUserId, msg.body.extUserId,
msg.body.name, msg.body.role, msg.body.authToken, Vector(msg.body.sessionToken), msg.body.name, msg.body.role, msg.body.authToken, Vector(msg.body.sessionToken),
msg.body.avatarURL, msg.body.webcamBackgroundURL, ColorPicker.nextColor(liveMeeting.props.meetingProp.intId), msg.body.guest, msg.body.authed, msg.body.avatarURL, msg.body.webcamBackgroundURL, ColorPicker.nextColor(liveMeeting.props.meetingProp.intId), msg.body.bot,
guestStatus, msg.body.excludeFromDashboard, msg.body.enforceLayout, msg.body.userMetadata, false) msg.body.guest, msg.body.authed, guestStatus, msg.body.excludeFromDashboard, msg.body.enforceLayout, msg.body.userMetadata, false)
checkUserConcurrentAccesses(regUser) checkUserConcurrentAccesses(regUser)
RegisteredUsers.add(liveMeeting.registeredUsers, regUser, liveMeeting.props.meetingProp.intId) RegisteredUsers.add(liveMeeting.registeredUsers, regUser, liveMeeting.props.meetingProp.intId)

View File

@ -33,7 +33,7 @@ trait UserJoinedVoiceConfEvtMsgHdlr extends SystemConfiguration {
def registerUserInRegisteredUsers() = { def registerUserInRegisteredUsers() = {
val regUser = RegisteredUsers.create(liveMeeting.props.meetingProp.intId, msg.body.intId, msg.body.voiceUserId, val regUser = RegisteredUsers.create(liveMeeting.props.meetingProp.intId, msg.body.intId, msg.body.voiceUserId,
msg.body.callerIdName, Roles.VIEWER_ROLE, msg.body.intId, Vector(""), "", "", userColor, msg.body.callerIdName, Roles.VIEWER_ROLE, msg.body.intId, Vector(""), "", "", userColor, false,
true, true, GuestStatus.WAIT, true, "", Map(), false) true, true, GuestStatus.WAIT, true, "", Map(), false)
RegisteredUsers.add(liveMeeting.registeredUsers, regUser, liveMeeting.props.meetingProp.intId) RegisteredUsers.add(liveMeeting.registeredUsers, regUser, liveMeeting.props.meetingProp.intId)
} }
@ -45,6 +45,7 @@ trait UserJoinedVoiceConfEvtMsgHdlr extends SystemConfiguration {
meetingId = liveMeeting.props.meetingProp.intId, meetingId = liveMeeting.props.meetingProp.intId,
name = msg.body.callerIdName, name = msg.body.callerIdName,
role = Roles.VIEWER_ROLE, role = Roles.VIEWER_ROLE,
bot = false,
guest = true, guest = true,
authed = true, authed = true,
guestStatus = GuestStatus.WAIT, guestStatus = GuestStatus.WAIT,

View File

@ -18,6 +18,7 @@ case class UserDbModel(
joinErrorCode: Option[String], joinErrorCode: Option[String],
banned: Boolean = false, banned: Boolean = false,
loggedOut: Boolean = false, loggedOut: Boolean = false,
bot: Boolean,
guest: Boolean, guest: Boolean,
guestStatus: String, guestStatus: String,
registeredOn: Long, registeredOn: Long,
@ -30,7 +31,7 @@ case class UserDbModel(
class UserDbTableDef(tag: Tag) extends Table[UserDbModel](tag, None, "user") { class UserDbTableDef(tag: Tag) extends Table[UserDbModel](tag, None, "user") {
override def * = ( override def * = (
meetingId,userId,extId,name,role,avatar,webcamBackground,color, authToken, authed,joined,joinErrorCode, meetingId,userId,extId,name,role,avatar,webcamBackground,color, authToken, authed,joined,joinErrorCode,
joinErrorMessage, banned,loggedOut,guest,guestStatus,registeredOn,excludeFromDashboard, enforceLayout) <> (UserDbModel.tupled, UserDbModel.unapply) joinErrorMessage, banned,loggedOut,bot, guest,guestStatus,registeredOn,excludeFromDashboard, enforceLayout) <> (UserDbModel.tupled, UserDbModel.unapply)
val meetingId = column[String]("meetingId", O.PrimaryKey) val meetingId = column[String]("meetingId", O.PrimaryKey)
val userId = column[String]("userId", O.PrimaryKey) val userId = column[String]("userId", O.PrimaryKey)
val extId = column[String]("extId") val extId = column[String]("extId")
@ -46,6 +47,7 @@ class UserDbTableDef(tag: Tag) extends Table[UserDbModel](tag, None, "user") {
val joinErrorMessage = column[Option[String]]("joinErrorMessage") val joinErrorMessage = column[Option[String]]("joinErrorMessage")
val banned = column[Boolean]("banned") val banned = column[Boolean]("banned")
val loggedOut = column[Boolean]("loggedOut") val loggedOut = column[Boolean]("loggedOut")
val bot = column[Boolean]("bot")
val guest = column[Boolean]("guest") val guest = column[Boolean]("guest")
val guestStatus = column[String]("guestStatus") val guestStatus = column[String]("guestStatus")
val registeredOn = column[Long]("registeredOn") val registeredOn = column[Long]("registeredOn")
@ -73,6 +75,7 @@ object UserDAO {
joinErrorMessage = None, joinErrorMessage = None,
banned = regUser.banned, banned = regUser.banned,
loggedOut = regUser.loggedOut, loggedOut = regUser.loggedOut,
bot = regUser.bot,
guest = regUser.guest, guest = regUser.guest,
guestStatus = regUser.guestStatus, guestStatus = regUser.guestStatus,
registeredOn = regUser.registeredOn, registeredOn = regUser.registeredOn,

View File

@ -6,8 +6,8 @@ import org.bigbluebutton.core.domain.BreakoutRoom2x
object RegisteredUsers { object RegisteredUsers {
def create(meetingId: String, userId: String, extId: String, name: String, roles: String, def create(meetingId: String, userId: String, extId: String, name: String, roles: String,
authToken: String, sessionToken: Vector[String], avatar: String, webcamBackground: String, color: String, guest: Boolean, authenticated: Boolean, authToken: String, sessionToken: Vector[String], avatar: String, webcamBackground: String, color: String, bot: Boolean,
guestStatus: String, excludeFromDashboard: Boolean, enforceLayout: String, guest: Boolean, authenticated: Boolean, guestStatus: String, excludeFromDashboard: Boolean, enforceLayout: String,
userMetadata: Map[String, String], loggedOut: Boolean): RegisteredUser = { userMetadata: Map[String, String], loggedOut: Boolean): RegisteredUser = {
new RegisteredUser( new RegisteredUser(
userId, userId,
@ -20,6 +20,7 @@ object RegisteredUsers {
avatar, avatar,
webcamBackground, webcamBackground,
color, color,
bot,
guest, guest,
authenticated, authenticated,
guestStatus, guestStatus,
@ -256,6 +257,7 @@ case class RegisteredUser(
avatarURL: String, avatarURL: String,
webcamBackgroundURL: String, webcamBackgroundURL: String,
color: String, color: String,
bot: Boolean,
guest: Boolean, guest: Boolean,
authed: Boolean, authed: Boolean,
guestStatus: String, guestStatus: String,

View File

@ -67,7 +67,7 @@ object Users2x {
} }
def numUsers(users: Users2x): Int = { def numUsers(users: Users2x): Int = {
users.toVector.length users.toVector.filter(u => !u.bot).length
} }
def numActiveModerators(users: Users2x): Int = { def numActiveModerators(users: Users2x): Int = {
@ -432,6 +432,7 @@ case class UserState(
meetingId: String, meetingId: String,
name: String, name: String,
role: String, role: String,
bot: Boolean,
guest: Boolean, guest: Boolean,
pin: Boolean, pin: Boolean,
mobile: Boolean, mobile: Boolean,

View File

@ -48,6 +48,7 @@ trait HandlerHelpers extends SystemConfiguration {
meetingId = regUser.meetingId, meetingId = regUser.meetingId,
name = regUser.name, name = regUser.name,
role = regUser.role, role = regUser.role,
bot = regUser.bot,
guest = regUser.guest, guest = regUser.guest,
authed = regUser.authed, authed = regUser.authed,
guestStatus = regUser.guestStatus, guestStatus = regUser.guestStatus,

View File

@ -9,7 +9,7 @@ object UserJoinedMeetingEvtMsgBuilder {
val envelope = BbbCoreEnvelope(UserJoinedMeetingEvtMsg.NAME, routing) val envelope = BbbCoreEnvelope(UserJoinedMeetingEvtMsg.NAME, routing)
val body = UserJoinedMeetingEvtMsgBody(intId = userState.intId, extId = userState.extId, name = userState.name, val body = UserJoinedMeetingEvtMsgBody(intId = userState.intId, extId = userState.extId, name = userState.name,
role = userState.role, guest = userState.guest, authed = userState.authed, role = userState.role, bot = userState.bot, guest = userState.guest, authed = userState.authed,
guestStatus = userState.guestStatus, guestStatus = userState.guestStatus,
reactionEmoji = userState.reactionEmoji, reactionEmoji = userState.reactionEmoji,
raiseHand = userState.raiseHand, raiseHand = userState.raiseHand,

View File

@ -9,21 +9,21 @@ import org.bigbluebutton.core.running.LiveMeeting
trait FakeTestData { trait FakeTestData {
def createFakeUsers(liveMeeting: LiveMeeting): Unit = { def createFakeUsers(liveMeeting: LiveMeeting): Unit = {
val mod1 = createUserVoiceAndCam(liveMeeting, Roles.MODERATOR_ROLE, false, false, CallingWith.WEBRTC, muted = false, val mod1 = createUserVoiceAndCam(liveMeeting, Roles.MODERATOR_ROLE, bot = false, false, false, CallingWith.WEBRTC, muted = false,
talking = true, listenOnly = false) talking = true, listenOnly = false)
Users2x.add(liveMeeting.users2x, mod1) Users2x.add(liveMeeting.users2x, mod1)
val mod2 = createUserVoiceAndCam(liveMeeting, Roles.MODERATOR_ROLE, guest = false, authed = true, CallingWith.WEBRTC, muted = false, val mod2 = createUserVoiceAndCam(liveMeeting, Roles.MODERATOR_ROLE, bot = false, guest = false, authed = true, CallingWith.WEBRTC, muted = false,
talking = false, listenOnly = false) talking = false, listenOnly = false)
Users2x.add(liveMeeting.users2x, mod2) Users2x.add(liveMeeting.users2x, mod2)
val guest1 = createUserVoiceAndCam(liveMeeting, Roles.VIEWER_ROLE, guest = true, authed = true, CallingWith.WEBRTC, muted = false, val guest1 = createUserVoiceAndCam(liveMeeting, Roles.VIEWER_ROLE, bot = false, guest = true, authed = true, CallingWith.WEBRTC, muted = false,
talking = false, listenOnly = false) talking = false, listenOnly = false)
Users2x.add(liveMeeting.users2x, guest1) Users2x.add(liveMeeting.users2x, guest1)
val guestWait1 = GuestWaiting(guest1.intId, guest1.name, guest1.role, guest1.guest, "", "", "#ff6242", guest1.authed, System.currentTimeMillis()) val guestWait1 = GuestWaiting(guest1.intId, guest1.name, guest1.role, guest1.guest, "", "", "#ff6242", guest1.authed, System.currentTimeMillis())
GuestsWaiting.add(liveMeeting.guestsWaiting, guestWait1) GuestsWaiting.add(liveMeeting.guestsWaiting, guestWait1)
val guest2 = createUserVoiceAndCam(liveMeeting, Roles.VIEWER_ROLE, guest = true, authed = true, CallingWith.FLASH, muted = false, val guest2 = createUserVoiceAndCam(liveMeeting, Roles.VIEWER_ROLE, bot = false, guest = true, authed = true, CallingWith.FLASH, muted = false,
talking = false, listenOnly = false) talking = false, listenOnly = false)
Users2x.add(liveMeeting.users2x, guest2) Users2x.add(liveMeeting.users2x, guest2)
val guestWait2 = GuestWaiting(guest2.intId, guest2.name, guest2.role, guest2.guest, "", "", "#ff6242", guest2.authed, System.currentTimeMillis()) val guestWait2 = GuestWaiting(guest2.intId, guest2.name, guest2.role, guest2.guest, "", "", "#ff6242", guest2.authed, System.currentTimeMillis())
@ -44,16 +44,16 @@ trait FakeTestData {
VoiceUsers.add(liveMeeting.voiceUsers, vu5) VoiceUsers.add(liveMeeting.voiceUsers, vu5)
for (i <- 1 to 50) { for (i <- 1 to 50) {
val guser = createUserVoiceAndCam(liveMeeting, Roles.MODERATOR_ROLE, guest = false, authed = true, CallingWith.WEBRTC, muted = false, val guser = createUserVoiceAndCam(liveMeeting, Roles.MODERATOR_ROLE, bot = false, guest = false, authed = true, CallingWith.WEBRTC, muted = false,
talking = false, listenOnly = false) talking = false, listenOnly = false)
Users2x.add(liveMeeting.users2x, guser) Users2x.add(liveMeeting.users2x, guser)
} }
} }
def createUserVoiceAndCam(liveMeeting: LiveMeeting, role: String, guest: Boolean, authed: Boolean, callingWith: String, def createUserVoiceAndCam(liveMeeting: LiveMeeting, role: String, bot: Boolean, guest: Boolean, authed: Boolean, callingWith: String,
muted: Boolean, talking: Boolean, listenOnly: Boolean): UserState = { muted: Boolean, talking: Boolean, listenOnly: Boolean): UserState = {
val ruser1 = FakeUserGenerator.createFakeRegisteredUser(liveMeeting.registeredUsers, Roles.MODERATOR_ROLE, true, false, liveMeeting.props.meetingProp.intId) val ruser1 = FakeUserGenerator.createFakeRegisteredUser(liveMeeting.registeredUsers, Roles.MODERATOR_ROLE, bot = false, true, false, liveMeeting.props.meetingProp.intId)
val vuser1 = FakeUserGenerator.createFakeVoiceUser(ruser1, "webrtc", muted = false, talking = true, listenOnly = false) val vuser1 = FakeUserGenerator.createFakeVoiceUser(ruser1, "webrtc", muted = false, talking = true, listenOnly = false)
VoiceUsers.add(liveMeeting.voiceUsers, vuser1) VoiceUsers.add(liveMeeting.voiceUsers, vuser1)
@ -70,7 +70,7 @@ trait FakeTestData {
def createFakeUser(liveMeeting: LiveMeeting, regUser: RegisteredUser): UserState = { def createFakeUser(liveMeeting: LiveMeeting, regUser: RegisteredUser): UserState = {
UserState(intId = regUser.id, extId = regUser.externId, meetingId = regUser.meetingId, UserState(intId = regUser.id, extId = regUser.externId, meetingId = regUser.meetingId,
name = regUser.name, role = regUser.role, pin = false, name = regUser.name, role = regUser.role, pin = false,
mobile = false, guest = regUser.guest, authed = regUser.authed, guestStatus = regUser.guestStatus, mobile = false, bot = regUser.bot, guest = regUser.guest, authed = regUser.authed, guestStatus = regUser.guestStatus,
reactionEmoji = "none", raiseHand = false, away = false, locked = false, presenter = false, reactionEmoji = "none", raiseHand = false, away = false, locked = false, presenter = false,
avatar = regUser.avatarURL, webcamBackground = regUser.webcamBackgroundURL, color = "#ff6242", clientType = "unknown", userLeftFlag = UserLeftFlag(false, 0)) avatar = regUser.avatarURL, webcamBackground = regUser.webcamBackgroundURL, color = "#ff6242", clientType = "unknown", userLeftFlag = UserLeftFlag(false, 0))
} }

View File

@ -45,7 +45,7 @@ object FakeUserGenerator {
private def getRandomElement(list: Seq[String], random: Random): String = list(random.nextInt(list.length)) private def getRandomElement(list: Seq[String], random: Random): String = list(random.nextInt(list.length))
def createFakeRegisteredUser(users: RegisteredUsers, role: String, guest: Boolean, authed: Boolean, meetingId: String): RegisteredUser = { def createFakeRegisteredUser(users: RegisteredUsers, role: String, bot: Boolean, guest: Boolean, authed: Boolean, meetingId: String): RegisteredUser = {
val name = getRandomElement(firstNames, random) + " " + getRandomElement(lastNames, random) val name = getRandomElement(firstNames, random) + " " + getRandomElement(lastNames, random)
val id = "w_" + RandomStringGenerator.randomAlphanumericString(16) val id = "w_" + RandomStringGenerator.randomAlphanumericString(16)
val extId = RandomStringGenerator.randomAlphanumericString(16) val extId = RandomStringGenerator.randomAlphanumericString(16)
@ -58,7 +58,8 @@ object FakeUserGenerator {
val color = "#ff6242" val color = "#ff6242"
val ru = RegisteredUsers.create(meetingId, userId = id, extId, name, role, val ru = RegisteredUsers.create(meetingId, userId = id, extId, name, role,
authToken, Vector(sessionToken), avatarURL, webcamBackgroundURL, color, guest, authed, guestStatus = GuestStatus.ALLOW, false, "", Map(), false) authToken, Vector(sessionToken), avatarURL, webcamBackgroundURL, color, bot,
guest, authed, guestStatus = GuestStatus.ALLOW, false, "", Map(), false)
RegisteredUsers.add(users, ru, meetingId) RegisteredUsers.add(users, ru, meetingId)
ru ru
} }

View File

@ -6,7 +6,7 @@ import org.bigbluebutton.core.util.RandomStringGenerator
object TestDataGen { object TestDataGen {
def createRegisteredUser(meetingId: String, users: RegisteredUsers, name: String, role: String, def createRegisteredUser(meetingId: String, users: RegisteredUsers, name: String, role: String,
guest: Boolean, authed: Boolean, waitForApproval: Boolean): RegisteredUser = { bot: Boolean, guest: Boolean, authed: Boolean, waitForApproval: Boolean): RegisteredUser = {
val id = "w_" + RandomStringGenerator.randomAlphanumericString(16) val id = "w_" + RandomStringGenerator.randomAlphanumericString(16)
val extId = RandomStringGenerator.randomAlphanumericString(16) val extId = RandomStringGenerator.randomAlphanumericString(16)
val authToken = RandomStringGenerator.randomAlphanumericString(16) val authToken = RandomStringGenerator.randomAlphanumericString(16)
@ -18,7 +18,8 @@ object TestDataGen {
val color = "#ff6242" val color = "#ff6242"
val ru = RegisteredUsers.create(meetingId, userId = id, extId, name, role, val ru = RegisteredUsers.create(meetingId, userId = id, extId, name, role,
authToken, Vector(sessionToken), avatarURL, webcamBackgroundURL, color, guest, authed, GuestStatus.ALLOW, false, "", Map(), false) authToken, Vector(sessionToken), avatarURL, webcamBackgroundURL, color, bot,
guest, authed, GuestStatus.ALLOW, false, "", Map(), false)
RegisteredUsers.add(users, ru, meetingId = "test") RegisteredUsers.add(users, ru, meetingId = "test")
ru ru
@ -76,7 +77,7 @@ object TestDataGen {
def createUserFor(liveMeeting: LiveMeeting, regUser: RegisteredUser, presenter: Boolean): UserState = { def createUserFor(liveMeeting: LiveMeeting, regUser: RegisteredUser, presenter: Boolean): UserState = {
val u = UserState(intId = regUser.id, extId = regUser.externId, meetingId = regUser.meetingId, name = regUser.name, val u = UserState(intId = regUser.id, extId = regUser.externId, meetingId = regUser.meetingId, name = regUser.name,
role = regUser.role, guest = regUser.guest, authed = regUser.authed, guestStatus = regUser.guestStatus, role = regUser.role,bot = regUser.bot, guest = regUser.guest, authed = regUser.authed, guestStatus = regUser.guestStatus,
reactionEmoji = "none", raiseHand = false, away = false, pin = false, mobile = false, reactionEmoji = "none", raiseHand = false, away = false, pin = false, mobile = false,
locked = false, presenter = false, avatar = regUser.avatarURL, regUser.webcamBackgroundURL, color = "#ff6242", locked = false, presenter = false, avatar = regUser.avatarURL, regUser.webcamBackgroundURL, color = "#ff6242",
clientType = "unknown", userLeftFlag = UserLeftFlag(false, 0)) clientType = "unknown", userLeftFlag = UserLeftFlag(false, 0))

View File

@ -121,7 +121,7 @@ case class AnswerVO(id: Int, key: String, text: Option[String], responders: Opti
case class QuestionVO(id: Int, questionType: String, multiResponse: Boolean, questionText: Option[String], answers: Option[Array[AnswerVO]]) case class QuestionVO(id: Int, questionType: String, multiResponse: Boolean, questionText: Option[String], answers: Option[Array[AnswerVO]])
case class PollVO(id: String, questions: Array[QuestionVO], title: Option[String], started: Boolean, stopped: Boolean, showResult: Boolean, isSecret: Boolean) case class PollVO(id: String, questions: Array[QuestionVO], title: Option[String], started: Boolean, stopped: Boolean, showResult: Boolean, isSecret: Boolean)
case class UserVO(id: String, externalId: String, name: String, role: String, case class UserVO(id: String, externalId: String, name: String, role: String, bot: Boolean,
guest: Boolean, authed: Boolean, guestStatus: String, emojiStatus: String, guest: Boolean, authed: Boolean, guestStatus: String, emojiStatus: String,
presenter: Boolean, hasStream: Boolean, locked: Boolean, webcamStreams: Set[String], presenter: Boolean, hasStream: Boolean, locked: Boolean, webcamStreams: Set[String],
phoneUser: Boolean, voiceUser: VoiceUserVO, listenOnly: Boolean, avatarURL: String, phoneUser: Boolean, voiceUser: VoiceUserVO, listenOnly: Boolean, avatarURL: String,

View File

@ -7,8 +7,9 @@ case class RegisterUserReqMsg(
) extends BbbCoreMsg ) extends BbbCoreMsg
case class RegisterUserReqMsgBody(meetingId: String, intUserId: String, name: String, role: String, case class RegisterUserReqMsgBody(meetingId: String, intUserId: String, name: String, role: String,
extUserId: String, authToken: String, sessionToken: String, avatarURL: String, extUserId: String, authToken: String, sessionToken: String, avatarURL: String,
webcamBackgroundURL: String, guest: Boolean, authed: Boolean, guestStatus: String, webcamBackgroundURL: String, bot: Boolean, guest: Boolean, authed: Boolean,
excludeFromDashboard: Boolean, enforceLayout: String, userMetadata: Map[String, String]) guestStatus: String, excludeFromDashboard: Boolean, enforceLayout: String,
userMetadata: Map[String, String])
object UserRegisteredRespMsg { val NAME = "UserRegisteredRespMsg" } object UserRegisteredRespMsg { val NAME = "UserRegisteredRespMsg" }
case class UserRegisteredRespMsg( case class UserRegisteredRespMsg(
@ -88,6 +89,7 @@ case class UserJoinedMeetingEvtMsgBody(
extId: String, extId: String,
name: String, name: String,
role: String, role: String,
bot: Boolean,
guest: Boolean, guest: Boolean,
authed: Boolean, authed: Boolean,
guestStatus: String, guestStatus: String,

View File

@ -134,12 +134,12 @@ public class MeetingService implements MessageListener {
public void registerUser(String meetingID, String internalUserId, public void registerUser(String meetingID, String internalUserId,
String fullname, String role, String externUserID, String fullname, String role, String externUserID,
String authToken, String sessionToken, String avatarURL, String webcamBackgroundURL, Boolean guest, String authToken, String sessionToken, String avatarURL, String webcamBackgroundURL, Boolean bot,
Boolean authed, String guestStatus, Boolean excludeFromDashboard, Boolean leftGuestLobby, Boolean guest, Boolean authed, String guestStatus, Boolean excludeFromDashboard, Boolean leftGuestLobby,
String enforceLayout, Map<String, String> userMetadata) { String enforceLayout, Map<String, String> userMetadata) {
handle( handle(
new RegisterUser(meetingID, internalUserId, fullname, role, new RegisterUser(meetingID, internalUserId, fullname, role,
externUserID, authToken, sessionToken, avatarURL, webcamBackgroundURL, guest, authed, guestStatus, externUserID, authToken, sessionToken, avatarURL, webcamBackgroundURL, bot, guest, authed, guestStatus,
excludeFromDashboard, leftGuestLobby, enforceLayout, userMetadata excludeFromDashboard, leftGuestLobby, enforceLayout, userMetadata
) )
); );
@ -572,8 +572,8 @@ public class MeetingService implements MessageListener {
private void processRegisterUser(RegisterUser message) { private void processRegisterUser(RegisterUser message) {
gw.registerUser(message.meetingID, gw.registerUser(message.meetingID,
message.internalUserId, message.fullname, message.role, message.internalUserId, message.fullname, message.role,
message.externUserID, message.authToken, message.sessionToken, message.avatarURL, message.webcamBackgroundURL, message.guest, message.externUserID, message.authToken, message.sessionToken, message.avatarURL, message.webcamBackgroundURL, message.bot,
message.authed, message.guestStatus, message.excludeFromDashboard, message.enforceLayout, message.userMetadata); message.guest, message.authed, message.guestStatus, message.excludeFromDashboard, message.enforceLayout, message.userMetadata);
} }
private void processRegisterUserSessionToken(RegisterUserSessionToken message) { private void processRegisterUserSessionToken(RegisterUserSessionToken message) {
@ -1073,8 +1073,8 @@ public class MeetingService implements MessageListener {
} }
User user = new User(message.userId, message.externalUserId, User user = new User(message.userId, message.externalUserId,
message.name, message.role, message.locked, message.avatarURL, message.webcamBackgroundURL, message.guest, message.guestStatus, message.name, message.role, message.locked, message.avatarURL, message.webcamBackgroundURL, message.bot,
message.clientType); message.guest, message.guestStatus, message.clientType);
if(m.getMaxUsers() > 0 && m.countUniqueExtIds() >= m.getMaxUsers()) { if(m.getMaxUsers() > 0 && m.countUniqueExtIds() >= m.getMaxUsers()) {
m.removeEnteredUser(user.getInternalUserId()); m.removeEnteredUser(user.getInternalUserId());
@ -1096,6 +1096,7 @@ public class MeetingService implements MessageListener {
logData.put("externalUserId", user.getExternalUserId()); logData.put("externalUserId", user.getExternalUserId());
logData.put("username", user.getFullname()); logData.put("username", user.getFullname());
logData.put("role", user.getRole()); logData.put("role", user.getRole());
logData.put("bot", user.isBot());
logData.put("guest", user.isGuest()); logData.put("guest", user.isGuest());
logData.put("guestStatus", user.getGuestStatus()); logData.put("guestStatus", user.getGuestStatus());
logData.put("logCode", "user_joined_message"); logData.put("logCode", "user_joined_message");
@ -1192,9 +1193,10 @@ public class MeetingService implements MessageListener {
user.setVoiceJoined(true); user.setVoiceJoined(true);
} else { } else {
if (message.userId.startsWith("v_")) { if (message.userId.startsWith("v_")) {
Boolean bot = false;
// A dial-in user joined the meeting. Dial-in users by convention has userId that starts with "v_". // A dial-in user joined the meeting. Dial-in users by convention has userId that starts with "v_".
User vuser = new User(message.userId, message.userId, message.name, "DIAL-IN-USER", true, "", "", User vuser = new User(message.userId, message.userId, message.name, "DIAL-IN-USER", true, "", "",
true, GuestPolicy.ALLOW, "DIAL-IN"); bot, true, GuestPolicy.ALLOW, "DIAL-IN");
vuser.setVoiceJoined(true); vuser.setVoiceJoined(true);
m.userJoined(vuser); m.userJoined(vuser);
} }

View File

@ -34,6 +34,7 @@ public class User {
private String avatarURL; private String avatarURL;
private String webcamBackgroundURL; private String webcamBackgroundURL;
private Map<String,String> status; private Map<String,String> status;
private Boolean bot;
private Boolean guest; private Boolean guest;
private String guestStatus; private String guestStatus;
private Boolean listeningOnly = false; private Boolean listeningOnly = false;
@ -49,6 +50,7 @@ public class User {
Boolean locked, Boolean locked,
String avatarURL, String avatarURL,
String webcamBackgroundURL, String webcamBackgroundURL,
Boolean bot,
Boolean guest, Boolean guest,
String guestStatus, String guestStatus,
String clientType) { String clientType) {
@ -59,6 +61,7 @@ public class User {
this.locked = locked; this.locked = locked;
this.avatarURL = avatarURL; this.avatarURL = avatarURL;
this.webcamBackgroundURL = webcamBackgroundURL; this.webcamBackgroundURL = webcamBackgroundURL;
this.bot = bot;
this.guest = guest; this.guest = guest;
this.guestStatus = guestStatus; this.guestStatus = guestStatus;
this.status = new ConcurrentHashMap<>(); this.status = new ConcurrentHashMap<>();
@ -81,6 +84,14 @@ public class User {
this.externalUserId = externalUserId; this.externalUserId = externalUserId;
} }
public void setBot(Boolean bot) {
this.bot = bot;
}
public Boolean isBot() {
return this.bot;
}
public void setGuest(Boolean guest) { public void setGuest(Boolean guest) {
this.guest = guest; this.guest = guest;
} }

View File

@ -32,6 +32,7 @@ public class UserSession {
public String role = null; public String role = null;
public String conference = null; public String conference = null;
public String room = null; public String room = null;
public Boolean bot = false;
public Boolean guest = false; public Boolean guest = false;
public Boolean authed = false; public Boolean authed = false;
public String voicebridge = null; public String voicebridge = null;

View File

@ -14,6 +14,7 @@ public class RegisterUser implements IMessage {
public final String sessionToken; public final String sessionToken;
public final String avatarURL; public final String avatarURL;
public final String webcamBackgroundURL; public final String webcamBackgroundURL;
public final Boolean bot;
public final Boolean guest; public final Boolean guest;
public final Boolean authed; public final Boolean authed;
public final String guestStatus; public final String guestStatus;
@ -23,7 +24,7 @@ public class RegisterUser implements IMessage {
public final Map<String, String> userMetadata; public final Map<String, String> userMetadata;
public RegisterUser(String meetingID, String internalUserId, String fullname, String role, String externUserID, public RegisterUser(String meetingID, String internalUserId, String fullname, String role, String externUserID,
String authToken, String sessionToken, String avatarURL, String webcamBackgroundURL, Boolean guest, String authToken, String sessionToken, String avatarURL, String webcamBackgroundURL, Boolean bot, Boolean guest,
Boolean authed, String guestStatus, Boolean excludeFromDashboard, Boolean leftGuestLobby, Boolean authed, String guestStatus, Boolean excludeFromDashboard, Boolean leftGuestLobby,
String enforceLayout, Map<String, String> userMetadata) { String enforceLayout, Map<String, String> userMetadata) {
this.meetingID = meetingID; this.meetingID = meetingID;
@ -35,6 +36,7 @@ public class RegisterUser implements IMessage {
this.sessionToken = sessionToken; this.sessionToken = sessionToken;
this.avatarURL = avatarURL; this.avatarURL = avatarURL;
this.webcamBackgroundURL = webcamBackgroundURL; this.webcamBackgroundURL = webcamBackgroundURL;
this.bot = bot;
this.guest = guest; this.guest = guest;
this.authed = authed; this.authed = authed;
this.guestStatus = guestStatus; this.guestStatus = guestStatus;

View File

@ -9,6 +9,7 @@ public class UserJoined implements IMessage {
public final Boolean locked; public final Boolean locked;
public final String avatarURL; public final String avatarURL;
public final String webcamBackgroundURL; public final String webcamBackgroundURL;
public final Boolean bot;
public final Boolean guest; public final Boolean guest;
public final String guestStatus; public final String guestStatus;
public final String clientType; public final String clientType;
@ -22,6 +23,7 @@ public class UserJoined implements IMessage {
Boolean locked, Boolean locked,
String avatarURL, String avatarURL,
String webcamBackgroundURL, String webcamBackgroundURL,
Boolean bot,
Boolean guest, Boolean guest,
String guestStatus, String guestStatus,
String clientType) { String clientType) {
@ -33,6 +35,7 @@ public class UserJoined implements IMessage {
this.locked = locked; this.locked = locked;
this.avatarURL = avatarURL; this.avatarURL = avatarURL;
this.webcamBackgroundURL = webcamBackgroundURL; this.webcamBackgroundURL = webcamBackgroundURL;
this.bot = bot;
this.guest = guest; this.guest = guest;
this.guestStatus = guestStatus; this.guestStatus = guestStatus;
this.clientType = clientType; this.clientType = clientType;

View File

@ -22,8 +22,8 @@ public interface IPublisherService {
void endMeeting(String meetingId); void endMeeting(String meetingId);
void send(String channel, String message); void send(String channel, String message);
void registerUser(String meetingID, String internalUserId, String fullname, String role, String externUserID, void registerUser(String meetingID, String internalUserId, String fullname, String role, String externUserID,
String authToken, String avatarURL, String webcamBackgroundURL, Boolean guest, Boolean excludeFromDashboard, String authToken, String avatarURL, String webcamBackgroundURL, Boolean bot, Boolean guest,
String enforceLayout, Boolean authed); Boolean excludeFromDashboard, String enforceLayout, Boolean authed);
void sendKeepAlive(String system, Long bbbWebTimestamp, Long akkaAppsTimestamp); void sendKeepAlive(String system, Long bbbWebTimestamp, Long akkaAppsTimestamp);
void sendStunTurnInfo(String meetingId, String internalUserId, Set<StunServer> stuns, Set<TurnEntry> turns); void sendStunTurnInfo(String meetingId, String internalUserId, Set<StunServer> stuns, Set<TurnEntry> turns);
} }

View File

@ -74,7 +74,7 @@ public interface IBbbWebApiGWApp {
void registerUser(String meetingID, String internalUserId, String fullname, String role, void registerUser(String meetingID, String internalUserId, String fullname, String role,
String externUserID, String authToken, String sessionToken, String avatarURL, String webcamBackgroundURL, String externUserID, String authToken, String sessionToken, String avatarURL, String webcamBackgroundURL,
Boolean guest, Boolean authed, String guestStatus, Boolean excludeFromDashboard, Boolean bot, Boolean guest, Boolean authed, String guestStatus, Boolean excludeFromDashboard,
String enforceLayout, Map<String, String> userMetadata); String enforceLayout, Map<String, String> userMetadata);
void registerUserSessionToken(String meetingID, String internalUserId, String sessionToken, void registerUserSessionToken(String meetingID, String internalUserId, String sessionToken,
String replaceSessionToken, String enforceLayout, Map<String, String> userSessionMetadata); String replaceSessionToken, String enforceLayout, Map<String, String> userSessionMetadata);

View File

@ -290,8 +290,8 @@ class BbbWebApiGWApp(
def registerUser(meetingId: String, intUserId: String, name: String, def registerUser(meetingId: String, intUserId: String, name: String,
role: String, extUserId: String, authToken: String, sessionToken: String, role: String, extUserId: String, authToken: String, sessionToken: String,
avatarURL: String, webcamBackgroundURL: String, guest: java.lang.Boolean, authed: java.lang.Boolean, avatarURL: String, webcamBackgroundURL: String, bot: java.lang.Boolean, guest: java.lang.Boolean,
guestStatus: String, excludeFromDashboard: java.lang.Boolean, authed: java.lang.Boolean, guestStatus: String, excludeFromDashboard: java.lang.Boolean,
enforceLayout: String, userMetadata: java.util.Map[String, String]): Unit = { enforceLayout: String, userMetadata: java.util.Map[String, String]): Unit = {
// meetingManagerActorRef ! new RegisterUser(meetingId = meetingId, intUserId = intUserId, name = name, // meetingManagerActorRef ! new RegisterUser(meetingId = meetingId, intUserId = intUserId, name = name,
@ -300,9 +300,9 @@ class BbbWebApiGWApp(
val regUser = new RegisterUser(meetingId = meetingId, intUserId = intUserId, name = name, val regUser = new RegisterUser(meetingId = meetingId, intUserId = intUserId, name = name,
role = role, extUserId = extUserId, authToken = authToken, sessionToken = sessionToken, role = role, extUserId = extUserId, authToken = authToken, sessionToken = sessionToken,
avatarURL = avatarURL, webcamBackgroundURL = webcamBackgroundURL, guest = guest.booleanValue(), authed = authed.booleanValue(), avatarURL = avatarURL, webcamBackgroundURL = webcamBackgroundURL, bot = bot.booleanValue(), guest = guest.booleanValue(),
guestStatus = guestStatus, excludeFromDashboard = excludeFromDashboard, enforceLayout = enforceLayout, authed = authed.booleanValue(), guestStatus = guestStatus, excludeFromDashboard = excludeFromDashboard,
userMetadata = (userMetadata).asScala.toMap) enforceLayout = enforceLayout, userMetadata = (userMetadata).asScala.toMap)
val event = MsgBuilder.buildRegisterUserRequestToAkkaApps(regUser) val event = MsgBuilder.buildRegisterUserRequestToAkkaApps(regUser)
msgToAkkaAppsEventBus.publish(MsgToAkkaApps(toAkkaAppsChannel, event)) msgToAkkaAppsEventBus.publish(MsgToAkkaApps(toAkkaAppsChannel, event))

View File

@ -50,8 +50,9 @@ object MsgBuilder {
val header = BbbCoreHeaderWithMeetingId(RegisterUserReqMsg.NAME, msg.meetingId) val header = BbbCoreHeaderWithMeetingId(RegisterUserReqMsg.NAME, msg.meetingId)
val body = RegisterUserReqMsgBody(meetingId = msg.meetingId, intUserId = msg.intUserId, val body = RegisterUserReqMsgBody(meetingId = msg.meetingId, intUserId = msg.intUserId,
name = msg.name, role = msg.role, extUserId = msg.extUserId, authToken = msg.authToken, sessionToken = msg.sessionToken, name = msg.name, role = msg.role, extUserId = msg.extUserId, authToken = msg.authToken, sessionToken = msg.sessionToken,
avatarURL = msg.avatarURL, webcamBackgroundURL = msg.webcamBackgroundURL, guest = msg.guest, authed = msg.authed, guestStatus = msg.guestStatus, avatarURL = msg.avatarURL, webcamBackgroundURL = msg.webcamBackgroundURL, bot = msg.bot, guest = msg.guest, authed = msg.authed,
excludeFromDashboard = msg.excludeFromDashboard, enforceLayout = msg.enforceLayout, userMetadata = msg.userMetadata) guestStatus = msg.guestStatus, excludeFromDashboard = msg.excludeFromDashboard, enforceLayout = msg.enforceLayout,
userMetadata = msg.userMetadata)
val req = RegisterUserReqMsg(header, body) val req = RegisterUserReqMsg(header, body)
BbbCommonEnvCoreMsg(envelope, req) BbbCommonEnvCoreMsg(envelope, req)
} }

View File

@ -17,7 +17,7 @@ case class CreateBreakoutRoomMsg(meetingId: String, parentMeetingId: String,
case class AddUserSession(token: String, session: UserSession) case class AddUserSession(token: String, session: UserSession)
case class RegisterUser(meetingId: String, intUserId: String, name: String, role: String, case class RegisterUser(meetingId: String, intUserId: String, name: String, role: String,
extUserId: String, authToken: String, sessionToken: String, avatarURL: String, webcamBackgroundURL: String, extUserId: String, authToken: String, sessionToken: String, avatarURL: String, webcamBackgroundURL: String,
guest: Boolean, authed: Boolean, guestStatus: String, excludeFromDashboard: Boolean, bot: Boolean, guest: Boolean, authed: Boolean, guestStatus: String, excludeFromDashboard: Boolean,
enforceLayout: String, userMetadata: Map[String, String]) enforceLayout: String, userMetadata: Map[String, String])
case class CreateMeetingMsg(defaultProps: DefaultProps) case class CreateMeetingMsg(defaultProps: DefaultProps)

View File

@ -143,7 +143,7 @@ class OldMeetingMsgHdlrActor(val olgMsgGW: OldMessageReceivedGW)
def handleUserJoinedMeetingEvtMsg(msg: UserJoinedMeetingEvtMsg): Unit = { def handleUserJoinedMeetingEvtMsg(msg: UserJoinedMeetingEvtMsg): Unit = {
olgMsgGW.handle(new UserJoined(msg.header.meetingId, msg.body.intId, olgMsgGW.handle(new UserJoined(msg.header.meetingId, msg.body.intId,
msg.body.extId, msg.body.name, msg.body.role, msg.body.locked, msg.body.avatar, msg.body.webcamBackground, msg.body.extId, msg.body.name, msg.body.role, msg.body.locked, msg.body.avatar, msg.body.webcamBackground,
msg.body.guest, msg.body.guestStatus, msg.body.clientType)) msg.body.bot, msg.body.guest, msg.body.guestStatus, msg.body.clientType))
} }
def handlePresenterUnassignedEvtMsg(msg: PresenterUnassignedEvtMsg): Unit = { def handlePresenterUnassignedEvtMsg(msg: PresenterUnassignedEvtMsg): Unit = {

View File

@ -28,8 +28,8 @@ trait ToAkkaAppsSendersTrait extends SystemConfiguration {
val header = BbbCoreHeaderWithMeetingId(RegisterUserReqMsg.NAME, msg.meetingId) val header = BbbCoreHeaderWithMeetingId(RegisterUserReqMsg.NAME, msg.meetingId)
val body = RegisterUserReqMsgBody(meetingId = msg.meetingId, intUserId = msg.intUserId, val body = RegisterUserReqMsgBody(meetingId = msg.meetingId, intUserId = msg.intUserId,
name = msg.name, role = msg.role, extUserId = msg.extUserId, authToken = msg.authToken, name = msg.name, role = msg.role, extUserId = msg.extUserId, authToken = msg.authToken,
sessionToken = msg.sessionToken, avatarURL = msg.avatarURL, webcamBackgroundURL = msg.webcamBackgroundURL, guest = msg.guest, authed = msg.authed, sessionToken = msg.sessionToken, avatarURL = msg.avatarURL, webcamBackgroundURL = msg.webcamBackgroundURL, bot = msg.bot,
guestStatus = msg.guestStatus, excludeFromDashboard = msg.excludeFromDashboard, guest = msg.guest, authed = msg.authed, guestStatus = msg.guestStatus, excludeFromDashboard = msg.excludeFromDashboard,
enforceLayout = msg.enforceLayout, userMetadata = msg.userMetadata) enforceLayout = msg.enforceLayout, userMetadata = msg.userMetadata)
val req = RegisterUserReqMsg(header, body) val req = RegisterUserReqMsg(header, body)
val message = BbbCommonEnvCoreMsg(envelope, req) val message = BbbCommonEnvCoreMsg(envelope, req)

View File

@ -276,6 +276,7 @@ CREATE TABLE "user" (
"joinErrorMessage" varchar(400), "joinErrorMessage" varchar(400),
"banned" bool, "banned" bool,
"loggedOut" bool, -- when user clicked Leave meeting button "loggedOut" bool, -- when user clicked Leave meeting button
"bot" bool, -- used to flag au
"guest" bool, --used for dialIn "guest" bool, --used for dialIn
"guestStatus" varchar(50), "guestStatus" varchar(50),
"registeredOn" bigint, "registeredOn" bigint,
@ -359,6 +360,7 @@ AS SELECT "user"."userId",
"user"."raiseHandTime", "user"."raiseHandTime",
"user"."reactionEmoji", "user"."reactionEmoji",
"user"."reactionEmojiTime", "user"."reactionEmojiTime",
"user"."bot",
"user"."guest", "user"."guest",
"user"."guestStatus", "user"."guestStatus",
"user"."mobile", "user"."mobile",

View File

@ -301,6 +301,11 @@ class ApiController {
authenticated = true authenticated = true
} }
Boolean bot = false;
if(!StringUtils.isEmpty(params.bot)) {
bot = Boolean.parseBoolean(params.bot)
}
if (!StringUtils.isEmpty(params.auth)) { if (!StringUtils.isEmpty(params.auth)) {
authenticated = Boolean.parseBoolean(params.auth) authenticated = Boolean.parseBoolean(params.auth)
@ -435,6 +440,7 @@ class ApiController {
us.mode = "LIVE" us.mode = "LIVE"
us.record = meeting.isRecord() us.record = meeting.isRecord()
us.welcome = meeting.getWelcomeMessage() us.welcome = meeting.getWelcomeMessage()
us.bot = bot
us.guest = guest us.guest = guest
us.authed = authenticated us.authed = authenticated
us.guestStatus = guestStatusVal us.guestStatus = guestStatusVal
@ -494,6 +500,7 @@ class ApiController {
sessionToken, sessionToken,
us.avatarURL, us.avatarURL,
us.webcamBackgroundURL, us.webcamBackgroundURL,
us.bot,
us.guest, us.guest,
us.authed, us.authed,
guestStatusVal, guestStatusVal,