Skip to content

Commit

Permalink
feat(visitors): Adds flag to enable live room feature.
Browse files Browse the repository at this point in the history
By default is disabled.
  • Loading branch information
damencho committed Jun 27, 2024
1 parent 68a667b commit 6b5c8c5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
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 @@ -386,6 +386,10 @@ jicofo {
# 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

# Whether to evaluate visitorsLive room flag, which can be controlled server-side
# via the room-metadata service
enable-live-room = false
}

xmpp {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class VisitorsConfig private constructor() {
val requireMucConfigFlag: Boolean by config {
"jicofo.visitors.require-muc-config-flag".from(newConfig)
}

val enableLiveRoom: Boolean by config {
"jicofo.visitors.enable-live-room".from(newConfig)
}

companion object {
@JvmField
val config = VisitorsConfig()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import org.jitsi.jicofo.TaskPools
import org.jitsi.jicofo.auth.AuthenticationAuthority
import org.jitsi.jicofo.auth.ErrorFactory
import org.jitsi.jicofo.metrics.JicofoMetricsContainer
import org.jitsi.jicofo.visitors.VisitorsConfig
import org.jitsi.utils.OrderedJsonObject
import org.jitsi.utils.logging2.createLogger
import org.jitsi.xmpp.extensions.jitsimeet.ConferenceIq
Expand Down Expand Up @@ -97,7 +98,7 @@ class ConferenceIqHandler(

val visitorSupported = query.properties.any { it.name == "visitors-version" }
val visitorRequested = query.properties.any { it.name == "visitor" && it.value == "true" }
if (visitorRequested && conference?.chatRoom?.visitorsLive != true) {
if (visitorRequested && VisitorsConfig.config.enableLiveRoom && conference?.chatRoom?.visitorsLive != true) {
response.isReady = false
response.addProperty(ConferenceIq.Property("live", "false"))
return response
Expand Down

0 comments on commit 6b5c8c5

Please sign in to comment.