-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MM-44651] Implement MaxCallParticipants
config setting
#93
Changes from 5 commits
dc0154b
94d9396
b25d752
3548002
ad4b096
abfb43a
894f444
36c67f6
2c60467
f2e408f
bceab79
8533208
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -298,13 +298,11 @@ func (p *Plugin) handleConfig(w http.ResponseWriter) error { | |
|
||
type config struct { | ||
clientConfig | ||
SkuShortName string `json:"sku_short_name"` | ||
CloudMaxParticipants int `json:"cloud_max_participants"` | ||
SkuShortName string `json:"sku_short_name"` | ||
} | ||
ret := config{ | ||
clientConfig: p.getConfiguration().getClientConfig(), | ||
SkuShortName: skuShortName, | ||
CloudMaxParticipants: cloudMaxParticipants, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realize this is a breaking change but given it only affects Cloud I think we can safely make it now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think... Good thing mobile isn't cut yet. :) |
||
clientConfig: p.getConfiguration().getClientConfig(), | ||
SkuShortName: skuShortName, | ||
} | ||
|
||
w.Header().Set("Content-Type", "application/json") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,9 @@ type clientConfig struct { | |
AllowEnableCalls *bool | ||
// When set to true, calls will be possible in all channels where they are not explicitly disabled. | ||
DefaultEnabled *bool | ||
// The maximum number of participants that can join a call. The zero value | ||
// means unlimited. | ||
MaxCallParticipants *int | ||
} | ||
|
||
type ICEServers []string | ||
|
@@ -104,9 +107,10 @@ func (pr PortsRange) IsValid() error { | |
|
||
func (c *configuration) getClientConfig() clientConfig { | ||
return clientConfig{ | ||
AllowEnableCalls: c.AllowEnableCalls, | ||
DefaultEnabled: c.DefaultEnabled, | ||
ICEServers: c.ICEServers, | ||
AllowEnableCalls: c.AllowEnableCalls, | ||
DefaultEnabled: c.DefaultEnabled, | ||
ICEServers: c.ICEServers, | ||
MaxCallParticipants: c.MaxCallParticipants, | ||
} | ||
} | ||
|
||
|
@@ -119,7 +123,9 @@ func (c *configuration) SetDefaults() { | |
} | ||
if c.DefaultEnabled == nil { | ||
c.DefaultEnabled = new(bool) | ||
*c.DefaultEnabled = true | ||
} | ||
if c.MaxCallParticipants == nil { | ||
c.MaxCallParticipants = new(int) | ||
} | ||
} | ||
|
||
|
@@ -132,6 +138,10 @@ func (c *configuration) IsValid() error { | |
return fmt.Errorf("UDPServerPort is not valid: %d is not in allowed range [1024, 49151]", *c.UDPServerPort) | ||
} | ||
|
||
if c.MaxCallParticipants == nil || *c.MaxCallParticipants < 0 { | ||
return fmt.Errorf("MaxCallParticipants is not valid") | ||
} | ||
|
||
return nil | ||
} | ||
|
||
|
@@ -162,6 +172,10 @@ func (c *configuration) Clone() *configuration { | |
} | ||
} | ||
|
||
if c.MaxCallParticipants != nil { | ||
cfg.MaxCallParticipants = model.NewInt(*c.MaxCallParticipants) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question for myself: why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly, I feel like Hamlet now 💀 Part of me wants to avoid relying on |
||
} | ||
|
||
return &cfg | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discovered in QA: Do we not want to allow on-prem to use the
MM_CALLS_MAX_PARTICIPANTS
flag?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's more like we need it on Cloud, not so much on on-prem although given it's not possible to use common configuration overrides due to the plugin id issue I think it makes sense to allow this to be used on non-cloud installations as well. I can update 👍