mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-28 09:48:13 -07:00
Merge pull request #591 from slingamn/history_autoresize.4
autoresizing of history buffers (#349)
This commit is contained in:
+5
-9
@@ -697,16 +697,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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user