Merge pull request #1245 from slingamn/issue1244

fix #1244
This commit is contained in:
Shivaram Lingamneni 2020-08-23 20:25:37 -07:00 committed by GitHub
commit 75a0e18580
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 3 deletions

View File

@ -815,7 +815,9 @@ history:
# users to do session resumption / query history after disconnections. # users to do session resumption / query history after disconnections.
grace-period: 1h 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: persistent:
enabled: false enabled: false

View File

@ -843,7 +843,9 @@ history:
# users to do session resumption / query history after disconnections. # users to do session resumption / query history after disconnections.
grace-period: 1h 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: persistent:
enabled: false enabled: false

View File

@ -1152,11 +1152,16 @@ func LoadConfig(filename string) (config *Config, err error) {
} }
if !config.History.Enabled || !config.History.Persistent.Enabled { if !config.History.Enabled || !config.History.Persistent.Enabled {
config.History.Persistent.Enabled = false
config.History.Persistent.UnregisteredChannels = false config.History.Persistent.UnregisteredChannels = false
config.History.Persistent.RegisteredChannels = PersistentDisabled config.History.Persistent.RegisteredChannels = PersistentDisabled
config.History.Persistent.DirectMessages = 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 { if config.History.ZNCMax == 0 {
config.History.ZNCMax = config.History.ChathistoryMax config.History.ZNCMax = config.History.ChathistoryMax
} }

View File

@ -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)) rb.Add(nil, server.name, RPL_INFO, nick, fmt.Sprintf(client.t("This is Oragono version %s."), SemVer))
if Commit != "" { 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 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, "")
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, client.t("Oragono is released under the MIT license."))
rb.Add(nil, server.name, RPL_INFO, nick, "") rb.Add(nil, server.name, RPL_INFO, nick, "")