diff --git a/irc/accounts.go b/irc/accounts.go index 530f3dff..6c827928 100644 --- a/irc/accounts.go +++ b/irc/accounts.go @@ -65,12 +65,12 @@ func (am *AccountManager) Initialize(server *Server) { am.accountToMethod = make(map[string]NickEnforcementMethod) am.server = server - am.buildNickToAccountIndex() + am.buildNickToAccountIndex(server.Config()) am.initVHostRequestQueue() } -func (am *AccountManager) buildNickToAccountIndex() { - if !am.server.AccountConfig().NickReservation.Enabled { +func (am *AccountManager) buildNickToAccountIndex(config *Config) { + if !config.Accounts.NickReservation.Enabled { return } diff --git a/irc/server.go b/irc/server.go index bb498139..bff1c482 100644 --- a/irc/server.go +++ b/irc/server.go @@ -658,7 +658,7 @@ func (server *Server) applyConfig(config *Config, initial bool) (err error) { nickReservationPreviouslyDisabled := oldConfig != nil && !oldConfig.Accounts.NickReservation.Enabled nickReservationNowEnabled := config.Accounts.NickReservation.Enabled if nickReservationPreviouslyDisabled && nickReservationNowEnabled { - server.accounts.buildNickToAccountIndex() + server.accounts.buildNickToAccountIndex(config) } hsPreviouslyDisabled := oldConfig != nil && !oldConfig.Accounts.VHosts.Enabled