From 6628a3d1c68744ab3e48962692bbd93d420fdfb0 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sun, 23 Aug 2020 18:10:01 -0400 Subject: [PATCH 1/2] fix #1244 --- conventional.yaml | 4 +++- default.yaml | 4 +++- irc/config.go | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) 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 } From ddb8400124e7621ee10f181b4df643bb137d03ce Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sun, 23 Aug 2020 21:59:19 -0400 Subject: [PATCH 2/2] include go version even without the git hash --- irc/handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/irc/handlers.go b/irc/handlers.go index 77e67c83..bc8e9a2b 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -1083,8 +1083,8 @@ func infoHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Resp rb.Add(nil, server.name, RPL_INFO, nick, fmt.Sprintf(client.t("This is Oragono version %s."), SemVer)) if Commit != "" { rb.Add(nil, server.name, RPL_INFO, nick, fmt.Sprintf(client.t("It was built from git hash %s."), Commit)) - rb.Add(nil, server.name, RPL_INFO, nick, fmt.Sprintf(client.t("It was compiled using %s."), runtime.Version())) } + rb.Add(nil, server.name, RPL_INFO, nick, fmt.Sprintf(client.t("It was compiled using %s."), runtime.Version())) rb.Add(nil, server.name, RPL_INFO, nick, "") rb.Add(nil, server.name, RPL_INFO, nick, client.t("Oragono is released under the MIT license.")) rb.Add(nil, server.name, RPL_INFO, nick, "")