diff --git a/irc/server.go b/irc/server.go index f3202aa2..a1452031 100644 --- a/irc/server.go +++ b/irc/server.go @@ -676,6 +676,14 @@ func (server *Server) applyConfig(config *Config, initial bool) (err error) { addedCaps.Add(caps.STS) } + if oldConfig != nil && config.Accounts.Bouncer.Enabled != oldConfig.Accounts.Bouncer.Enabled { + if config.Accounts.Bouncer.Enabled { + addedCaps.Add(caps.Bouncer) + } else { + removedCaps.Add(caps.Bouncer) + } + } + // resize history buffers as needed if oldConfig != nil && oldConfig.History != config.History { for _, channel := range server.channels.Channels() { @@ -686,6 +694,9 @@ func (server *Server) applyConfig(config *Config, initial bool) (err error) { } } + // activate the new config + server.SetConfig(config) + // burst new and removed caps var capBurstSessions []*Session added := make(map[caps.Version][]string) @@ -720,9 +731,6 @@ func (server *Server) applyConfig(config *Config, initial bool) (err error) { } } - // save a pointer to the new config - server.SetConfig(config) - server.logger.Info("server", "Using datastore", config.Datastore.Path) if initial { if err := server.loadDatastore(config); err != nil {