summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-11-24 05:26:45 -0800
committerHarrison Healey <harrisonmhealey@gmail.com>2016-11-24 08:26:45 -0500
commitb212acf312ad640455fa715427ac19e6930dc61d (patch)
tree8fb977e00bef33587c3199ad3617417b27fb6b8a /model
parent0f07a2d288bada5e08cd9a63047ee85ef60738f5 (diff)
downloadchat-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')
-rw-r--r--model/config.go10
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, "")
}