add implicit_control to stats.

This commit is contained in:
Miroslav Šedivý 2021-12-11 15:15:29 +01:00
parent f4682d3f1c
commit 5be8319d8a
3 changed files with 5 additions and 3 deletions

View File

@ -68,8 +68,8 @@ func (WebRTC) Init(cmd *cobra.Command) error {
}
// TODO: Should be moved to session config.
cmd.PersistentFlags().Bool("implicit-control", false, "if enabled members can gain control implicitly")
if err := viper.BindPFlag("implicit-control", cmd.PersistentFlags().Lookup("implicit-control")); err != nil {
cmd.PersistentFlags().Bool("implicit_control", false, "if enabled members can gain control implicitly")
if err := viper.BindPFlag("implicit_control", cmd.PersistentFlags().Lookup("implicit_control")); err != nil {
return err
}
@ -130,5 +130,5 @@ func (s *WebRTC) Set() {
}
// TODO: Should be moved to session config.
s.ImplicitControl = viper.GetBool("implicit-control")
s.ImplicitControl = viper.GetBool("implicit_control")
}

View File

@ -18,6 +18,7 @@ type Stats struct {
LastUserLeftAt *time.Time `json:"last_user_left_at"`
ControlProtection bool `json:"control_protection"`
ImplicitControl bool `json:"implicit_control"`
}
type WebSocket interface {

View File

@ -316,6 +316,7 @@ func (ws *WebSocketHandler) Stats() types.Stats {
LastUserLeftAt: ws.lastUserLeftAt,
ControlProtection: ws.conf.ControlProtection,
ImplicitControl: ws.handler.webrtc.ImplicitControl(),
}
}