summaryrefslogtreecommitdiffstats
path: root/model/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/config.go')
-rw-r--r--model/config.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go
index 8d49434f6..09bf11a71 100644
--- a/model/config.go
+++ b/model/config.go
@@ -223,6 +223,7 @@ type TeamSettings struct {
RestrictPublicChannelManagement *string
RestrictPrivateChannelManagement *string
UserStatusAwayTimeout *int64
+ MaxChannelsPerTeam *int64
}
type LdapSettings struct {
@@ -502,6 +503,11 @@ func (o *Config) SetDefaults() {
*o.TeamSettings.UserStatusAwayTimeout = 300
}
+ if o.TeamSettings.MaxChannelsPerTeam == nil {
+ o.TeamSettings.MaxChannelsPerTeam = new(int64)
+ *o.TeamSettings.MaxChannelsPerTeam = 2000
+ }
+
if o.EmailSettings.EnableSignInWithEmail == nil {
o.EmailSettings.EnableSignInWithEmail = new(bool)
@@ -984,6 +990,10 @@ func (o *Config) IsValid() *AppError {
return NewLocAppError("Config.IsValid", "model.config.is_valid.max_users.app_error", nil, "")
}
+ if *o.TeamSettings.MaxChannelsPerTeam <= 0 {
+ return NewLocAppError("Config.IsValid", "model.config.is_valid.max_channels.app_error", nil, "")
+ }
+
if !(*o.TeamSettings.RestrictDirectMessage == DIRECT_MESSAGE_ANY || *o.TeamSettings.RestrictDirectMessage == DIRECT_MESSAGE_TEAM) {
return NewLocAppError("Config.IsValid", "model.config.is_valid.restrict_direct_message.app_error", nil, "")
}