Apply default user modes just before registration.

Previously, we were applying defaults before the user had completed
registration. This meant that the number of invisible users was
incremented when the user connected, and then the total was incremented
when registration was completed.

Now both counters are updated at the same time. If a user disconnects
prior to registration, +i has not yet been applied so it would not be
decremented.
This commit is contained in:
Alex Jaspersen 2020-05-28 15:53:14 +00:00
parent c1d4c5596d
commit 0241e0c31d
6 changed files with 37 additions and 25 deletions

View file

@ -256,7 +256,7 @@ type AccountConfig struct {
exemptedNets []net.IPNet
} `yaml:"require-sasl"`
DefaultUserModes *string `yaml:"default-user-modes"`
defaultUserModes modes.ModeChanges
defaultUserModes modes.Modes
LDAP ldap.ServerConfig
LoginThrottling ThrottleConfig `yaml:"login-throttling"`
SkipServerPassword bool `yaml:"skip-server-password"`