MM-30048 added thread related socket messages (#16234)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Eli Yukelzon
2020-11-20 11:00:52 +02:00
коммит произвёл GitHub
родитель 7b515d27f2
Коммит cf4df5fcd2
11 изменённых файлов: 190 добавлений и 26 удалений

Просмотреть файл

@@ -83,6 +83,10 @@ const (
GROUP_UNREAD_CHANNELS_DEFAULT_ON = "default_on"
GROUP_UNREAD_CHANNELS_DEFAULT_OFF = "default_off"
COLLAPSED_THREADS_DISABLED = "disabled"
COLLAPSED_THREADS_DEFAULT_ON = "default_on"
COLLAPSED_THREADS_DEFAULT_OFF = "default_off"
EMAIL_BATCHING_BUFFER_SIZE = 256
EMAIL_BATCHING_INTERVAL = 30
@@ -351,6 +355,7 @@ type ServiceSettings struct {
FeatureFlagSyncIntervalSeconds *int `access:"environment,write_restrictable"`
DebugSplit *bool `access:"environment,write_restrictable"`
ThreadAutoFollow *bool `access:"experimental"`
CollapsedThreads *string `access:"experimental"`
ManagedResourcePaths *string `access:"environment,write_restrictable,cloud_restrictable"`
}
@@ -786,6 +791,10 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) {
s.ThreadAutoFollow = NewBool(true)
}
if s.CollapsedThreads == nil {
s.CollapsedThreads = NewString(COLLAPSED_THREADS_DISABLED)
}
if s.ManagedResourcePaths == nil {
s.ManagedResourcePaths = NewString("")
}
@@ -3437,6 +3446,12 @@ func (s *ServiceSettings) isValid() *AppError {
return NewAppError("Config.IsValid", "model.config.is_valid.group_unread_channels.app_error", nil, "", http.StatusBadRequest)
}
if *s.CollapsedThreads != COLLAPSED_THREADS_DISABLED &&
*s.CollapsedThreads != COLLAPSED_THREADS_DEFAULT_ON &&
*s.CollapsedThreads != COLLAPSED_THREADS_DEFAULT_OFF {
return NewAppError("Config.IsValid", "model.config.is_valid.collapsed_threads.app_error", nil, "", http.StatusBadRequest)
}
return nil
}