Skip to content

Commit

Permalink
Add a config option to require the visitors flag in MUC config. (#1127)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrozev authored Jan 19, 2024
1 parent b33632d commit 258eb98
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jicofo-selector/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,10 @@ jicofo {
# With this option enabled the second part is started automatically as soon as any visitors join. Otherwise, jicofo
# waits to receive a <broadcast enabled=true> extension from one of the moderators in the conference.
auto-enable-broadcast = true

# Whether to require the "visitorsEnabled" flag in the MUC config form before enabling visitors for a conference.
# This allows the visitors option to be controlled per-conference.
require-muc-config-flag = false
}

xmpp {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1681,6 +1681,13 @@ public String redirectVisitor(boolean visitorRequested)
{
return null;
}
if (VisitorsConfig.config.getRequireMucConfigFlag())
{
if (chatRoom == null || !Boolean.TRUE.equals(chatRoom.getVisitorsEnabled()))
{
return null;
}
}
// We don't support visitors in breakout rooms.
if (mainRoomJid != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class VisitorsConfig private constructor() {
"jicofo.visitors.auto-enable-broadcast".from(newConfig)
}

val requireMucConfigFlag: Boolean by config {
"jicofo.visitors.require-muc-config-flag".from(newConfig)
}
companion object {
@JvmField
val config = VisitorsConfig()
Expand Down

0 comments on commit 258eb98

Please sign in to comment.