Skip to content

Commit

Permalink
feat: Once visitors are enabled, always redirect. (#1123)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrozev authored Dec 1, 2023
1 parent 600217b commit 660d705
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1688,13 +1688,18 @@ public String redirectVisitor(boolean visitorRequested)
}

long participantCount = getUserParticipantCount();
boolean visitorsAlreadyUsed = false;
synchronized (visitorChatRooms)
{
visitorsAlreadyUsed = !visitorChatRooms.isEmpty();
}

if (!visitorRequested && participantCount < VisitorsConfig.config.getMaxParticipants())
if (visitorsAlreadyUsed || visitorRequested || participantCount >= VisitorsConfig.config.getMaxParticipants())
{
return null;
return selectVisitorNode();
}

return selectVisitorNode();
return null;
}

private long userParticipantCount = 0;
Expand Down

0 comments on commit 660d705

Please sign in to comment.