add client compatibility switches

This commit is contained in:
Shivaram Lingamneni 2019-05-09 14:18:30 -04:00
parent 939729a7c0
commit fbc6c84a01
6 changed files with 54 additions and 17 deletions

View file

@ -286,9 +286,14 @@ type Config struct {
WebIRC []webircConfig `yaml:"webirc"`
MaxSendQString string `yaml:"max-sendq"`
MaxSendQBytes int
AllowPlaintextResume bool `yaml:"allow-plaintext-resume"`
ConnectionLimiter connection_limits.LimiterConfig `yaml:"connection-limits"`
ConnectionThrottler connection_limits.ThrottlerConfig `yaml:"connection-throttling"`
AllowPlaintextResume bool `yaml:"allow-plaintext-resume"`
Compatibility struct {
ForceTrailing *bool `yaml:"force-trailing"`
forceTrailing bool
SendUnprefixedSasl bool `yaml:"send-unprefixed-sasl"`
}
ConnectionLimiter connection_limits.LimiterConfig `yaml:"connection-limits"`
ConnectionThrottler connection_limits.ThrottlerConfig `yaml:"connection-throttling"`
}
Languages struct {
@ -698,6 +703,13 @@ func LoadConfig(filename string) (config *Config, err error) {
config.Channels.Registration.MaxChannelsPerAccount = 15
}
forceTrailingPtr := config.Server.Compatibility.ForceTrailing
if forceTrailingPtr != nil {
config.Server.Compatibility.forceTrailing = *forceTrailingPtr
} else {
config.Server.Compatibility.forceTrailing = true
}
// in the current implementation, we disable history by creating a history buffer
// with zero capacity. but the `enabled` config option MUST be respected regardless
// of this detail