1
0
Fork 0
forked from External/ergo

autoresizing of history buffers (#349)

This commit is contained in:
Shivaram Lingamneni 2019-05-19 16:34:52 -04:00
parent 7761323f01
commit 6e9a728354
7 changed files with 190 additions and 31 deletions

View file

@ -672,16 +672,12 @@ func (server *Server) applyConfig(config *Config, initial bool) (err error) {
}
// resize history buffers as needed
if oldConfig != nil {
if oldConfig.History.ChannelLength != config.History.ChannelLength {
for _, channel := range server.channels.Channels() {
channel.history.Resize(config.History.ChannelLength)
}
if oldConfig != nil && oldConfig.History != config.History {
for _, channel := range server.channels.Channels() {
channel.history.Resize(config.History.ChannelLength, config.History.AutoresizeWindow)
}
if oldConfig.History.ClientLength != config.History.ClientLength {
for _, client := range server.clients.AllClients() {
client.history.Resize(config.History.ClientLength)
}
for _, client := range server.clients.AllClients() {
client.history.Resize(config.History.ClientLength, config.History.AutoresizeWindow)
}
}