diff --git a/conventional.yaml b/conventional.yaml index 87f1d8c1..35d4b115 100644 --- a/conventional.yaml +++ b/conventional.yaml @@ -815,7 +815,9 @@ history: # users to do session resumption / query history after disconnections. grace-period: 1h - # options to store history messages in a persistent database (currently only MySQL): + # options to store history messages in a persistent database (currently only MySQL). + # in order to enable any of this functionality, you must configure a MySQL server + # in the `datastore.mysql` section. persistent: enabled: false diff --git a/default.yaml b/default.yaml index 332c670c..b80bd423 100644 --- a/default.yaml +++ b/default.yaml @@ -843,7 +843,9 @@ history: # users to do session resumption / query history after disconnections. grace-period: 1h - # options to store history messages in a persistent database (currently only MySQL): + # options to store history messages in a persistent database (currently only MySQL). + # in order to enable any of this functionality, you must configure a MySQL server + # in the `datastore.mysql` section. persistent: enabled: false diff --git a/irc/config.go b/irc/config.go index 0a9a76bc..f5b6c83a 100644 --- a/irc/config.go +++ b/irc/config.go @@ -1152,11 +1152,16 @@ func LoadConfig(filename string) (config *Config, err error) { } if !config.History.Enabled || !config.History.Persistent.Enabled { + config.History.Persistent.Enabled = false config.History.Persistent.UnregisteredChannels = false config.History.Persistent.RegisteredChannels = PersistentDisabled config.History.Persistent.DirectMessages = PersistentDisabled } + if config.History.Persistent.Enabled && !config.Datastore.MySQL.Enabled { + return nil, fmt.Errorf("You must configure a MySQL server in order to enable persistent history") + } + if config.History.ZNCMax == 0 { config.History.ZNCMax = config.History.ChathistoryMax }