Fix inconsistent behavior when history.enabled is set but
history.chathistory-maxmessages is not
This commit is contained in:
Shivaram Lingamneni 2025-12-14 02:13:15 -05:00 committed by GitHub
parent aef5d77b3b
commit fdd261a1e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 4 deletions

View file

@ -1611,7 +1611,7 @@ func LoadConfig(filename string) (config *Config, err error) {
// in the current implementation, we disable history by creating a history buffer
// with zero capacity. but the `enabled` config option MUST be respected regardless
// of this detail
if !config.History.Enabled {
if !config.History.Enabled || config.History.ChathistoryMax == 0 {
config.History.ChannelLength = 0
config.History.ClientLength = 0
config.Server.supportedCaps.Disable(caps.Chathistory)