forked from External/ergo
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:
parent
c1d4c5596d
commit
0241e0c31d
6 changed files with 37 additions and 25 deletions
|
|
@ -266,11 +266,18 @@ func (server *Server) tryRegister(c *Client, session *Session) (exiting bool) {
|
|||
return true
|
||||
}
|
||||
|
||||
// Apply default user modes (without updating the invisible counter)
|
||||
// The number of invisible users will be updated by server.stats.Register
|
||||
// if we're using default user mode +i.
|
||||
for _, defaultMode := range server.Config().Accounts.defaultUserModes {
|
||||
c.SetMode(defaultMode, true)
|
||||
}
|
||||
|
||||
// registration has succeeded:
|
||||
c.SetRegistered()
|
||||
|
||||
// count new user in statistics
|
||||
server.stats.Register()
|
||||
server.stats.Register(c.HasMode(modes.Invisible))
|
||||
server.monitorManager.AlertAbout(c, true)
|
||||
|
||||
server.playRegistrationBurst(session)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue