Преглед на файлове

rename config keys from review feedback

tags/v2.1.0-rc1
Shivaram Lingamneni преди 4 години
родител
ревизия
edd161ddfd
променени са 5 файла, в които са добавени 15 реда и са изтрити 15 реда
  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 Целия файл

@@ -348,11 +348,11 @@ func (am *AccountManager) Register(client *Client, account string, callbackNames
348 348
 	// as an account; this prevents "land-grab" situations where someone else
349 349
 	// registers your nick out from under you and then NS GHOSTs you
350 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 352
 	// register a guest nickname anyway, and the actual registration system
353 353
 	// will prevent any double-register
354 354
 	if client != nil && config.Accounts.NickReservation.Enabled &&
355
-		!config.Accounts.NickReservation.EnforceGuestFormat &&
355
+		!config.Accounts.NickReservation.ForceGuestFormat &&
356 356
 		client.NickCasefolded() != casefoldedAccount {
357 357
 		return errAccountMustHoldNick
358 358
 	}

+ 2
- 2
irc/client_lookup_set.go Целия файл

@@ -131,7 +131,7 @@ func (clients *ClientManager) SetNick(client *Client, session *Session, newNick
131 131
 	var alwaysOn, useAccountName bool
132 132
 	if account != "" {
133 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 137
 	if useAccountName {
@@ -150,7 +150,7 @@ func (clients *ClientManager) SetNick(client *Client, session *Session, newNick
150 150
 			return "", errNickMissing
151 151
 		}
152 152
 
153
-		if account == "" && config.Accounts.NickReservation.EnforceGuestFormat {
153
+		if account == "" && config.Accounts.NickReservation.ForceGuestFormat {
154 154
 			newNick = strings.Replace(config.Accounts.NickReservation.GuestFormat, "*", newNick, 1)
155 155
 		}
156 156
 

+ 6
- 6
irc/config.go Целия файл

@@ -251,12 +251,12 @@ type AccountConfig struct {
251 251
 		AllowCustomEnforcement bool          `yaml:"allow-custom-enforcement"`
252 252
 		RenameTimeout          time.Duration `yaml:"rename-timeout"`
253 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 260
 	} `yaml:"nick-reservation"`
261 261
 	Multiclient MulticlientConfig
262 262
 	Bouncer     *MulticlientConfig // # handle old name for 'multiclient'

+ 3
- 3
irc/nickserv.go Целия файл

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

+ 2
- 2
oragono.yaml Целия файл

@@ -356,13 +356,13 @@ accounts:
356 356
         # a nickname matching the guest template. a caveat: this may prevent
357 357
         # users from choosing nicknames in scripts different from the guest
358 358
         # nickname format.
359
-        enforce-guest-format: false
359
+        force-guest-format: false
360 360
 
361 361
         # when enabled, forces users logged into an account to use the
362 362
         # account name as their nickname. when combined with strict nickname
363 363
         # enforcement, this lets users treat nicknames and account names
364 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 367
     # multiclient controls whether oragono allows multiple connections to
368 368
     # attach to the same client/nickname identity; this is part of the

Loading…
Отказ
Запис