diff --git a/irc/accounts.go b/irc/accounts.go index 6c827928..d3b0b9fc 100644 --- a/irc/accounts.go +++ b/irc/accounts.go @@ -65,8 +65,9 @@ func (am *AccountManager) Initialize(server *Server) { am.accountToMethod = make(map[string]NickEnforcementMethod) am.server = server - am.buildNickToAccountIndex(server.Config()) - am.initVHostRequestQueue() + config := server.Config() + am.buildNickToAccountIndex(config) + am.initVHostRequestQueue(config) } func (am *AccountManager) buildNickToAccountIndex(config *Config) { @@ -135,8 +136,8 @@ func (am *AccountManager) buildNickToAccountIndex(config *Config) { } } -func (am *AccountManager) initVHostRequestQueue() { - if !am.server.AccountConfig().VHosts.Enabled { +func (am *AccountManager) initVHostRequestQueue(config *Config) { + if !config.Accounts.VHosts.Enabled { return } diff --git a/irc/server.go b/irc/server.go index bff1c482..412a1e94 100644 --- a/irc/server.go +++ b/irc/server.go @@ -664,7 +664,7 @@ func (server *Server) applyConfig(config *Config, initial bool) (err error) { hsPreviouslyDisabled := oldConfig != nil && !oldConfig.Accounts.VHosts.Enabled hsNowEnabled := config.Accounts.VHosts.Enabled if hsPreviouslyDisabled && hsNowEnabled { - server.accounts.initVHostRequestQueue() + server.accounts.initVHostRequestQueue(config) } chanRegPreviouslyDisabled := oldConfig != nil && !oldConfig.Channels.Registration.Enabled