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
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
0f07a2d288
Коммит
b212acf312
@@ -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, "")
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user