Browse Source

rename config keys from review feedback

tags/v2.1.0-rc1
Shivaram Lingamneni 4 years ago
parent
commit
edd161ddfd
5 changed files with 15 additions and 15 deletions
  1. 2
    2
      irc/accounts.go
  2. 2
    2
      irc/client_lookup_set.go
  3. 6
    6
      irc/config.go
  4. 3
    3
      irc/nickserv.go
  5. 2
    2
      oragono.yaml

+ 2
- 2
irc/accounts.go View File

348
 	// as an account; this prevents "land-grab" situations where someone else
348
 	// as an account; this prevents "land-grab" situations where someone else
349
 	// registers your nick out from under you and then NS GHOSTs you
349
 	// registers your nick out from under you and then NS GHOSTs you
350
 	// n.b. client is nil during a SAREGISTER
350
 	// n.b. client is nil during a SAREGISTER
351
-	// n.b. if EnforceGuestFormat, then there's no concern, because you can't
351
+	// n.b. if ForceGuestFormat, then there's no concern, because you can't
352
 	// register a guest nickname anyway, and the actual registration system
352
 	// register a guest nickname anyway, and the actual registration system
353
 	// will prevent any double-register
353
 	// will prevent any double-register
354
 	if client != nil && config.Accounts.NickReservation.Enabled &&
354
 	if client != nil && config.Accounts.NickReservation.Enabled &&
355
-		!config.Accounts.NickReservation.EnforceGuestFormat &&
355
+		!config.Accounts.NickReservation.ForceGuestFormat &&
356
 		client.NickCasefolded() != casefoldedAccount {
356
 		client.NickCasefolded() != casefoldedAccount {
357
 		return errAccountMustHoldNick
357
 		return errAccountMustHoldNick
358
 	}
358
 	}

+ 2
- 2
irc/client_lookup_set.go View File

131
 	var alwaysOn, useAccountName bool
131
 	var alwaysOn, useAccountName bool
132
 	if account != "" {
132
 	if account != "" {
133
 		alwaysOn = persistenceEnabled(config.Accounts.Multiclient.AlwaysOn, settings.AlwaysOn)
133
 		alwaysOn = persistenceEnabled(config.Accounts.Multiclient.AlwaysOn, settings.AlwaysOn)
134
-		useAccountName = alwaysOn || config.Accounts.NickReservation.EnforceAccountName
134
+		useAccountName = alwaysOn || config.Accounts.NickReservation.ForceNickEqualsAccount
135
 	}
135
 	}
136
 
136
 
137
 	if useAccountName {
137
 	if useAccountName {
150
 			return "", errNickMissing
150
 			return "", errNickMissing
151
 		}
151
 		}
152
 
152
 
153
-		if account == "" && config.Accounts.NickReservation.EnforceGuestFormat {
153
+		if account == "" && config.Accounts.NickReservation.ForceGuestFormat {
154
 			newNick = strings.Replace(config.Accounts.NickReservation.GuestFormat, "*", newNick, 1)
154
 			newNick = strings.Replace(config.Accounts.NickReservation.GuestFormat, "*", newNick, 1)
155
 		}
155
 		}
156
 
156
 

+ 6
- 6
irc/config.go View File

251
 		AllowCustomEnforcement bool          `yaml:"allow-custom-enforcement"`
251
 		AllowCustomEnforcement bool          `yaml:"allow-custom-enforcement"`
252
 		RenameTimeout          time.Duration `yaml:"rename-timeout"`
252
 		RenameTimeout          time.Duration `yaml:"rename-timeout"`
253
 		// RenamePrefix is the legacy field, GuestFormat is the new version
253
 		// RenamePrefix is the legacy field, GuestFormat is the new version
254
-		RenamePrefix       string `yaml:"rename-prefix"`
255
-		GuestFormat        string `yaml:"guest-nickname-format"`
256
-		guestRegexp        *regexp.Regexp
257
-		guestRegexpFolded  *regexp.Regexp
258
-		EnforceGuestFormat bool `yaml:"enforce-guest-format"`
259
-		EnforceAccountName bool `yaml:"enforce-account-name"`
254
+		RenamePrefix           string `yaml:"rename-prefix"`
255
+		GuestFormat            string `yaml:"guest-nickname-format"`
256
+		guestRegexp            *regexp.Regexp
257
+		guestRegexpFolded      *regexp.Regexp
258
+		ForceGuestFormat       bool `yaml:"force-guest-format"`
259
+		ForceNickEqualsAccount bool `yaml:"force-nick-equals-account"`
260
 	} `yaml:"nick-reservation"`
260
 	} `yaml:"nick-reservation"`
261
 	Multiclient MulticlientConfig
261
 	Multiclient MulticlientConfig
262
 	Bouncer     *MulticlientConfig // # handle old name for 'multiclient'
262
 	Bouncer     *MulticlientConfig // # handle old name for 'multiclient'

+ 3
- 3
irc/nickserv.go View File

610
 	return true
610
 	return true
611
 }
611
 }
612
 
612
 
613
-// if enforce-account-name is set, account name and nickname must be equal,
613
+// if force-nick-equals-account is set, account name and nickname must be equal,
614
 // so we need to re-NICK automatically on every login event (IDENTIFY,
614
 // so we need to re-NICK automatically on every login event (IDENTIFY,
615
 // VERIFY, and a REGISTER that auto-verifies). if we can't get the nick
615
 // VERIFY, and a REGISTER that auto-verifies). if we can't get the nick
616
 // then we log them out (they will be able to reattach with SASL)
616
 // then we log them out (they will be able to reattach with SASL)
617
 func nsFixNickname(client *Client, rb *ResponseBuffer, config *Config) (success bool) {
617
 func nsFixNickname(client *Client, rb *ResponseBuffer, config *Config) (success bool) {
618
-	if !config.Accounts.NickReservation.EnforceAccountName {
618
+	if !config.Accounts.NickReservation.ForceNickEqualsAccount {
619
 		return true
619
 		return true
620
 	}
620
 	}
621
 	// don't need to supply a nickname, SetNick will use the account name
621
 	// don't need to supply a nickname, SetNick will use the account name
753
 
753
 
754
 	config := server.Config()
754
 	config := server.Config()
755
 	account := details.nick
755
 	account := details.nick
756
-	if config.Accounts.NickReservation.EnforceGuestFormat {
756
+	if config.Accounts.NickReservation.ForceGuestFormat {
757
 		matches := config.Accounts.NickReservation.guestRegexp.FindStringSubmatch(account)
757
 		matches := config.Accounts.NickReservation.guestRegexp.FindStringSubmatch(account)
758
 		if matches == nil || len(matches) < 2 {
758
 		if matches == nil || len(matches) < 2 {
759
 			nsNotice(rb, client.t("Erroneous nickname"))
759
 			nsNotice(rb, client.t("Erroneous nickname"))

+ 2
- 2
oragono.yaml View File

356
         # a nickname matching the guest template. a caveat: this may prevent
356
         # a nickname matching the guest template. a caveat: this may prevent
357
         # users from choosing nicknames in scripts different from the guest
357
         # users from choosing nicknames in scripts different from the guest
358
         # nickname format.
358
         # nickname format.
359
-        enforce-guest-format: false
359
+        force-guest-format: false
360
 
360
 
361
         # when enabled, forces users logged into an account to use the
361
         # when enabled, forces users logged into an account to use the
362
         # account name as their nickname. when combined with strict nickname
362
         # account name as their nickname. when combined with strict nickname
363
         # enforcement, this lets users treat nicknames and account names
363
         # enforcement, this lets users treat nicknames and account names
364
         # as equivalent for the purpose of ban/invite/exception lists.
364
         # as equivalent for the purpose of ban/invite/exception lists.
365
-        enforce-account-name: false
365
+        force-nick-equals-account: false
366
 
366
 
367
     # multiclient controls whether oragono allows multiple connections to
367
     # multiclient controls whether oragono allows multiple connections to
368
     # attach to the same client/nickname identity; this is part of the
368
     # attach to the same client/nickname identity; this is part of the

Loading…
Cancel
Save