mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 10:42:52 +01:00
add cap-notify for bouncer
This commit is contained in:
parent
ca17e58b3a
commit
8a33d68cf1
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user