Browse Source

fix #1244

tags/v2.3.0-rc2
Shivaram Lingamneni 3 years ago
parent
commit
6628a3d1c6
3 changed files with 11 additions and 2 deletions
  1. 3
    1
      conventional.yaml
  2. 3
    1
      default.yaml
  3. 5
    0
      irc/config.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
 	}

Loading…
Cancel
Save