Quellcode durchsuchen

Merge pull request #1245 from slingamn/issue1244

fix #1244
tags/v2.3.0-rc2
Shivaram Lingamneni vor 3 Jahren
Ursprung
Commit
75a0e18580
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden
4 geänderte Dateien mit 12 neuen und 3 gelöschten Zeilen
  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 Datei anzeigen

815
         # users to do session resumption / query history after disconnections.
815
         # users to do session resumption / query history after disconnections.
816
         grace-period: 1h
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
     persistent:
821
     persistent:
820
         enabled: false
822
         enabled: false
821
 
823
 

+ 3
- 1
default.yaml Datei anzeigen

843
         # users to do session resumption / query history after disconnections.
843
         # users to do session resumption / query history after disconnections.
844
         grace-period: 1h
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
     persistent:
849
     persistent:
848
         enabled: false
850
         enabled: false
849
 
851
 

+ 5
- 0
irc/config.go Datei anzeigen

1152
 	}
1152
 	}
1153
 
1153
 
1154
 	if !config.History.Enabled || !config.History.Persistent.Enabled {
1154
 	if !config.History.Enabled || !config.History.Persistent.Enabled {
1155
+		config.History.Persistent.Enabled = false
1155
 		config.History.Persistent.UnregisteredChannels = false
1156
 		config.History.Persistent.UnregisteredChannels = false
1156
 		config.History.Persistent.RegisteredChannels = PersistentDisabled
1157
 		config.History.Persistent.RegisteredChannels = PersistentDisabled
1157
 		config.History.Persistent.DirectMessages = PersistentDisabled
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
 	if config.History.ZNCMax == 0 {
1165
 	if config.History.ZNCMax == 0 {
1161
 		config.History.ZNCMax = config.History.ChathistoryMax
1166
 		config.History.ZNCMax = config.History.ChathistoryMax
1162
 	}
1167
 	}

+ 1
- 1
irc/handlers.go Datei anzeigen

1083
 	rb.Add(nil, server.name, RPL_INFO, nick, fmt.Sprintf(client.t("This is Oragono version %s."), SemVer))
1083
 	rb.Add(nil, server.name, RPL_INFO, nick, fmt.Sprintf(client.t("This is Oragono version %s."), SemVer))
1084
 	if Commit != "" {
1084
 	if Commit != "" {
1085
 		rb.Add(nil, server.name, RPL_INFO, nick, fmt.Sprintf(client.t("It was built from git hash %s."), Commit))
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
 	rb.Add(nil, server.name, RPL_INFO, nick, "")
1088
 	rb.Add(nil, server.name, RPL_INFO, nick, "")
1089
 	rb.Add(nil, server.name, RPL_INFO, nick, client.t("Oragono is released under the MIT license."))
1089
 	rb.Add(nil, server.name, RPL_INFO, nick, client.t("Oragono is released under the MIT license."))
1090
 	rb.Add(nil, server.name, RPL_INFO, nick, "")
1090
 	rb.Add(nil, server.name, RPL_INFO, nick, "")

Laden…
Abbrechen
Speichern