diff options
Diffstat (limited to 'model')
-rw-r--r-- | model/config.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go index 40c76efe5..f9a1d4861 100644 --- a/model/config.go +++ b/model/config.go @@ -226,6 +226,7 @@ type TeamSettings struct { RestrictPrivateChannelManagement *string UserStatusAwayTimeout *int64 MaxChannelsPerTeam *int64 + MaxNotificationsPerChannel *int64 } type LdapSettings struct { @@ -507,6 +508,11 @@ func (o *Config) SetDefaults() { *o.TeamSettings.MaxChannelsPerTeam = 2000 } + if o.TeamSettings.MaxNotificationsPerChannel == nil { + o.TeamSettings.MaxNotificationsPerChannel = new(int64) + *o.TeamSettings.MaxNotificationsPerChannel = 1000 + } + if o.EmailSettings.EnableSignInWithEmail == nil { o.EmailSettings.EnableSignInWithEmail = new(bool) @@ -1003,6 +1009,10 @@ func (o *Config) IsValid() *AppError { return NewLocAppError("Config.IsValid", "model.config.is_valid.max_channels.app_error", nil, "") } + if *o.TeamSettings.MaxNotificationsPerChannel <= 0 { + return NewLocAppError("Config.IsValid", "model.config.is_valid.max_notify_per_channel.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, "") } |