Browse Source

make roleplay.enabled default to false when unset

See #1240.
tags/v2.4.0-rc1
Shivaram Lingamneni 3 years ago
parent
commit
6a0d11d449
2 changed files with 3 additions and 5 deletions
  1. 2
    4
      irc/config.go
  2. 1
    1
      irc/roleplay.go

+ 2
- 4
irc/config.go View File

@@ -537,8 +537,7 @@ type Config struct {
537 537
 	}
538 538
 
539 539
 	Roleplay struct {
540
-		Enabled        *bool
541
-		enabled        bool
540
+		Enabled        bool
542 541
 		RequireChanops bool  `yaml:"require-chanops"`
543 542
 		RequireOper    bool  `yaml:"require-oper"`
544 543
 		AddSuffix      *bool `yaml:"add-suffix"`
@@ -1192,7 +1191,6 @@ func LoadConfig(filename string) (config *Config, err error) {
1192 1191
 		config.History.ZNCMax = config.History.ChathistoryMax
1193 1192
 	}
1194 1193
 
1195
-	config.Roleplay.enabled = utils.BoolDefaultTrue(config.Roleplay.Enabled)
1196 1194
 	config.Roleplay.addSuffix = utils.BoolDefaultTrue(config.Roleplay.AddSuffix)
1197 1195
 
1198 1196
 	config.Datastore.MySQL.ExpireTime = time.Duration(config.History.Restrictions.ExpireTime)
@@ -1272,7 +1270,7 @@ func (config *Config) generateISupport() (err error) {
1272 1270
 	isupport.Add("NETWORK", config.Network.Name)
1273 1271
 	isupport.Add("NICKLEN", strconv.Itoa(config.Limits.NickLen))
1274 1272
 	isupport.Add("PREFIX", "(qaohv)~&@%+")
1275
-	if config.Roleplay.enabled {
1273
+	if config.Roleplay.Enabled {
1276 1274
 		isupport.Add("RPCHAN", "E")
1277 1275
 		isupport.Add("RPUSER", "E")
1278 1276
 	}

+ 1
- 1
irc/roleplay.go View File

@@ -18,7 +18,7 @@ const (
18 18
 
19 19
 func sendRoleplayMessage(server *Server, client *Client, source string, targetString string, isAction bool, messageParts []string, rb *ResponseBuffer) {
20 20
 	config := server.Config()
21
-	if !config.Roleplay.enabled {
21
+	if !config.Roleplay.Enabled {
22 22
 		rb.Add(nil, client.server.name, ERR_CANNOTSENDRP, targetString, client.t("Roleplaying has been disabled by the server administrators"))
23 23
 		return
24 24
 	}

Loading…
Cancel
Save