summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-01-30 15:43:34 -0500
committerGitHub <noreply@github.com>2017-01-30 15:43:34 -0500
commit450c0b3ccb091a3f84f35aca0319ba358ffd5633 (patch)
treeb10df23ff6a7410b9e61be2c8b1c1215e9b5aa28 /model
parentb26329cdda2ff599d01afbe01b2e2df3896a6b57 (diff)
downloadchat-450c0b3ccb091a3f84f35aca0319ba358ffd5633.tar.gz
chat-450c0b3ccb091a3f84f35aca0319ba358ffd5633.tar.bz2
chat-450c0b3ccb091a3f84f35aca0319ba358ffd5633.zip
Improvments to typing messages (#5230)
Diffstat (limited to 'model')
-rw-r--r--model/config.go94
1 files changed, 55 insertions, 39 deletions
diff --git a/model/config.go b/model/config.go
index 13e795170..4588731b6 100644
--- a/model/config.go
+++ b/model/config.go
@@ -64,45 +64,47 @@ const (
)
type ServiceSettings struct {
- SiteURL *string
- ListenAddress string
- ConnectionSecurity *string
- TLSCertFile *string
- TLSKeyFile *string
- UseLetsEncrypt *bool
- LetsEncryptCertificateCacheFile *string
- Forward80To443 *bool
- ReadTimeout *int
- WriteTimeout *int
- MaximumLoginAttempts int
- SegmentDeveloperKey string
- GoogleDeveloperKey string
- EnableOAuthServiceProvider bool
- EnableIncomingWebhooks bool
- EnableOutgoingWebhooks bool
- EnableCommands *bool
- EnableOnlyAdminIntegrations *bool
- EnablePostUsernameOverride bool
- EnablePostIconOverride bool
- EnableTesting bool
- EnableDeveloper *bool
- EnableSecurityFixAlert *bool
- EnableInsecureOutgoingConnections *bool
- EnableMultifactorAuthentication *bool
- EnforceMultifactorAuthentication *bool
- AllowCorsFrom *string
- SessionLengthWebInDays *int
- SessionLengthMobileInDays *int
- SessionLengthSSOInDays *int
- SessionCacheInMinutes *int
- WebsocketSecurePort *int
- WebsocketPort *int
- WebserverMode *string
- EnableCustomEmoji *bool
- RestrictCustomEmojiCreation *string
- RestrictPostDelete *string
- AllowEditPost *string
- PostEditTimeLimit *int
+ SiteURL *string
+ ListenAddress string
+ ConnectionSecurity *string
+ TLSCertFile *string
+ TLSKeyFile *string
+ UseLetsEncrypt *bool
+ LetsEncryptCertificateCacheFile *string
+ Forward80To443 *bool
+ ReadTimeout *int
+ WriteTimeout *int
+ MaximumLoginAttempts int
+ SegmentDeveloperKey string
+ GoogleDeveloperKey string
+ EnableOAuthServiceProvider bool
+ EnableIncomingWebhooks bool
+ EnableOutgoingWebhooks bool
+ EnableCommands *bool
+ EnableOnlyAdminIntegrations *bool
+ EnablePostUsernameOverride bool
+ EnablePostIconOverride bool
+ EnableTesting bool
+ EnableDeveloper *bool
+ EnableSecurityFixAlert *bool
+ EnableInsecureOutgoingConnections *bool
+ EnableMultifactorAuthentication *bool
+ EnforceMultifactorAuthentication *bool
+ AllowCorsFrom *string
+ SessionLengthWebInDays *int
+ SessionLengthMobileInDays *int
+ SessionLengthSSOInDays *int
+ SessionCacheInMinutes *int
+ WebsocketSecurePort *int
+ WebsocketPort *int
+ WebserverMode *string
+ EnableCustomEmoji *bool
+ RestrictCustomEmojiCreation *string
+ RestrictPostDelete *string
+ AllowEditPost *string
+ PostEditTimeLimit *int
+ TimeBetweenUserTypingUpdatesMilliseconds *int64
+ EnableUserTypingMessages *bool
}
type ClusterSettings struct {
@@ -1072,6 +1074,16 @@ func (o *Config) SetDefaults() {
*o.MetricsSettings.BlockProfileRate = 0
}
+ if o.ServiceSettings.TimeBetweenUserTypingUpdatesMilliseconds == nil {
+ o.ServiceSettings.TimeBetweenUserTypingUpdatesMilliseconds = new(int64)
+ *o.ServiceSettings.TimeBetweenUserTypingUpdatesMilliseconds = 5000
+ }
+
+ if o.ServiceSettings.EnableUserTypingMessages == nil {
+ o.ServiceSettings.EnableUserTypingMessages = new(bool)
+ *o.ServiceSettings.EnableUserTypingMessages = true
+ }
+
o.defaultWebrtcSettings()
}
@@ -1303,6 +1315,10 @@ func (o *Config) IsValid() *AppError {
return NewLocAppError("Config.IsValid", "model.config.is_valid.write_timeout.app_error", nil, "")
}
+ if *o.ServiceSettings.TimeBetweenUserTypingUpdatesMilliseconds < 1000 {
+ return NewLocAppError("Config.IsValid", "model.config.is_valid.time_between_user_typing.app_error", nil, "")
+ }
+
return nil
}