Browse Source

Merge pull request #1245 from slingamn/issue1244

fix #1244
tags/v2.3.0-rc2
Shivaram Lingamneni 3 years ago
parent
commit
75a0e18580
No account linked to committer's email address
4 changed files with 12 additions and 3 deletions
  1. 3
    1
      conventional.yaml
  2. 3
    1
      default.yaml
  3. 5
    0
      irc/config.go
  4. 1
    1
      irc/handlers.go

+ 3
- 1
conventional.yaml View File

@@ -815,7 +815,9 @@ history:
815 815
         # users to do session resumption / query history after disconnections.
816 816
         grace-period: 1h
817 817
 
818
-    # options to store history messages in a persistent database (currently only MySQL):
818
+    # options to store history messages in a persistent database (currently only MySQL).
819
+    # in order to enable any of this functionality, you must configure a MySQL server
820
+    # in the `datastore.mysql` section.
819 821
     persistent:
820 822
         enabled: false
821 823
 

+ 3
- 1
default.yaml View File

@@ -843,7 +843,9 @@ history:
843 843
         # users to do session resumption / query history after disconnections.
844 844
         grace-period: 1h
845 845
 
846
-    # options to store history messages in a persistent database (currently only MySQL):
846
+    # options to store history messages in a persistent database (currently only MySQL).
847
+    # in order to enable any of this functionality, you must configure a MySQL server
848
+    # in the `datastore.mysql` section.
847 849
     persistent:
848 850
         enabled: false
849 851
 

+ 5
- 0
irc/config.go View File

@@ -1152,11 +1152,16 @@ func LoadConfig(filename string) (config *Config, err error) {
1152 1152
 	}
1153 1153
 
1154 1154
 	if !config.History.Enabled || !config.History.Persistent.Enabled {
1155
+		config.History.Persistent.Enabled = false
1155 1156
 		config.History.Persistent.UnregisteredChannels = false
1156 1157
 		config.History.Persistent.RegisteredChannels = PersistentDisabled
1157 1158
 		config.History.Persistent.DirectMessages = PersistentDisabled
1158 1159
 	}
1159 1160
 
1161
+	if config.History.Persistent.Enabled && !config.Datastore.MySQL.Enabled {
1162
+		return nil, fmt.Errorf("You must configure a MySQL server in order to enable persistent history")
1163
+	}
1164
+
1160 1165
 	if config.History.ZNCMax == 0 {
1161 1166
 		config.History.ZNCMax = config.History.ChathistoryMax
1162 1167
 	}

+ 1
- 1
irc/handlers.go View File

@@ -1083,8 +1083,8 @@ func infoHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Resp
1083 1083
 	rb.Add(nil, server.name, RPL_INFO, nick, fmt.Sprintf(client.t("This is Oragono version %s."), SemVer))
1084 1084
 	if Commit != "" {
1085 1085
 		rb.Add(nil, server.name, RPL_INFO, nick, fmt.Sprintf(client.t("It was built from git hash %s."), Commit))
1086
-		rb.Add(nil, server.name, RPL_INFO, nick, fmt.Sprintf(client.t("It was compiled using %s."), runtime.Version()))
1087 1086
 	}
1087
+	rb.Add(nil, server.name, RPL_INFO, nick, fmt.Sprintf(client.t("It was compiled using %s."), runtime.Version()))
1088 1088
 	rb.Add(nil, server.name, RPL_INFO, nick, "")
1089 1089
 	rb.Add(nil, server.name, RPL_INFO, nick, client.t("Oragono is released under the MIT license."))
1090 1090
 	rb.Add(nil, server.name, RPL_INFO, nick, "")

Loading…
Cancel
Save