diff options
author | Corey Hulen <corey@hulen.com> | 2016-11-24 05:26:45 -0800 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-11-24 08:26:45 -0500 |
commit | b212acf312ad640455fa715427ac19e6930dc61d (patch) | |
tree | 8fb977e00bef33587c3199ad3617417b27fb6b8a /model/config.go | |
parent | 0f07a2d288bada5e08cd9a63047ee85ef60738f5 (diff) | |
download | chat-b212acf312ad640455fa715427ac19e6930dc61d.tar.gz chat-b212acf312ad640455fa715427ac19e6930dc61d.tar.bz2 chat-b212acf312ad640455fa715427ac19e6930dc61d.zip |
PLT-4429 disabling at_all at_channel metions mentions when channel has more than 1k users (#4627)
* PLT-4429 disabling explicit mentions when channel has more than 1k users
* Fixing test case
* Adding setting to the admin console
* Fixing bad translation
Diffstat (limited to 'model/config.go')
-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, "") } |