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
         # 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 View File

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 View File

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
 	}

Loading…
Cancel
Save