diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserJoinMeetingReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserJoinMeetingReqMsgHdlr.scala index eee0edcede..527f232e10 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserJoinMeetingReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserJoinMeetingReqMsgHdlr.scala @@ -83,7 +83,7 @@ trait UserJoinMeetingReqMsgHdlr extends HandlerHelpers { if (maxParticipants > 0 && //0 = no limit RegisteredUsers.numUniqueJoinedUsers(liveMeeting.registeredUsers) >= maxParticipants && - !userHasJoinedAlready) { + !userHasJoinedAlready && !regUser.bot) { Left(("The maximum number of participants allowed for this meeting has been reached.", EjectReasonCode.MAX_PARTICIPANTS)) } else { Right(()) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Users2x.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Users2x.scala index 134bc94b12..41b5a7ed80 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Users2x.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Users2x.scala @@ -67,7 +67,7 @@ object Users2x { } def numUsers(users: Users2x): Int = { - users.toVector.filter(u => !u.bot).length + users.toVector.length } def numActiveModerators(users: Users2x): Int = { diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java index e75a59b5d1..d90caa30a9 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java @@ -1076,7 +1076,7 @@ public class MeetingService implements MessageListener { message.name, message.role, message.locked, message.avatarURL, message.webcamBackgroundURL, message.bot, message.guest, message.guestStatus, message.clientType); - if(m.getMaxUsers() > 0 && m.countUniqueExtIds() >= m.getMaxUsers()) { + if(m.getMaxUsers() > 0 && m.countUniqueExtIds() >= m.getMaxUsers() && !user.isBot()) { m.removeEnteredUser(user.getInternalUserId()); return; } diff --git a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy index 82c9369f39..61467172cc 100755 --- a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy +++ b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy @@ -1864,6 +1864,8 @@ class ApiController { Boolean reenter = meeting.getEnteredUserById(us.internalUserId) != null; // User are able to rejoin if he already joined previously with the same extId Boolean userExtIdAlreadyJoined = meeting.getUsersWithExtId(us.externUserID).size() > 0 + // Bot users should not be affected by max partiicpants limitation + Boolean isBot = us.bot // Users that already joined the meeting // It will count only unique users in order to avoid the same user from filling all slots int joinedUniqueUsers = meeting.countUniqueExtIds() @@ -1873,7 +1875,7 @@ class ApiController { log.info("Entered users - ${enteredUsers}. Joined users - ${joinedUniqueUsers}") Boolean reachedMax = joinedUniqueUsers >= maxParticipants; - if (enabled && !rejoin && !reenter && !userExtIdAlreadyJoined && reachedMax) { + if (enabled && !rejoin && !reenter && !userExtIdAlreadyJoined && reachedMax && !isBot) { return true; }