Bladeren bron

Merge pull request #1339 from slingamn/issue1337

fix #1337
tags/v2.4.0-rc1
Shivaram Lingamneni 3 jaren geleden
bovenliggende
commit
4737578748
No account linked to committer's email address
4 gewijzigde bestanden met toevoegingen van 15 en 0 verwijderingen
  1. 5
    0
      conventional.yaml
  2. 5
    0
      default.yaml
  3. 1
    0
      irc/config.go
  4. 4
    0
      irc/handlers.go

+ 5
- 0
conventional.yaml Bestand weergeven

433
         # as equivalent for the purpose of ban/invite/exception lists.
433
         # as equivalent for the purpose of ban/invite/exception lists.
434
         force-nick-equals-account: false
434
         force-nick-equals-account: false
435
 
435
 
436
+        # parallel setting to force-nick-equals-account: if true, this forbids
437
+        # anonymous users (i.e., users not logged into an account) to change their
438
+        # nickname after the initial connection is complete
439
+        forbid-anon-nick-changes: false
440
+
436
     # multiclient controls whether oragono allows multiple connections to
441
     # multiclient controls whether oragono allows multiple connections to
437
     # attach to the same client/nickname identity; this is part of the
442
     # attach to the same client/nickname identity; this is part of the
438
     # functionality traditionally provided by a bouncer like ZNC
443
     # functionality traditionally provided by a bouncer like ZNC

+ 5
- 0
default.yaml Bestand weergeven

461
         # as equivalent for the purpose of ban/invite/exception lists.
461
         # as equivalent for the purpose of ban/invite/exception lists.
462
         force-nick-equals-account: true
462
         force-nick-equals-account: true
463
 
463
 
464
+        # parallel setting to force-nick-equals-account: if true, this forbids
465
+        # anonymous users (i.e., users not logged into an account) to change their
466
+        # nickname after the initial connection is complete
467
+        forbid-anonymous-nick-changes: false
468
+
464
     # multiclient controls whether oragono allows multiple connections to
469
     # multiclient controls whether oragono allows multiple connections to
465
     # attach to the same client/nickname identity; this is part of the
470
     # attach to the same client/nickname identity; this is part of the
466
     # functionality traditionally provided by a bouncer like ZNC
471
     # functionality traditionally provided by a bouncer like ZNC

+ 1
- 0
irc/config.go Bestand weergeven

274
 		guestRegexpFolded      *regexp.Regexp
274
 		guestRegexpFolded      *regexp.Regexp
275
 		ForceGuestFormat       bool `yaml:"force-guest-format"`
275
 		ForceGuestFormat       bool `yaml:"force-guest-format"`
276
 		ForceNickEqualsAccount bool `yaml:"force-nick-equals-account"`
276
 		ForceNickEqualsAccount bool `yaml:"force-nick-equals-account"`
277
+		ForbidAnonNickChanges  bool `yaml:"forbid-anonymous-nick-changes"`
277
 	} `yaml:"nick-reservation"`
278
 	} `yaml:"nick-reservation"`
278
 	Multiclient MulticlientConfig
279
 	Multiclient MulticlientConfig
279
 	Bouncer     *MulticlientConfig // # handle old name for 'multiclient'
280
 	Bouncer     *MulticlientConfig // # handle old name for 'multiclient'

+ 4
- 0
irc/handlers.go Bestand weergeven

1919
 // NICK <nickname>
1919
 // NICK <nickname>
1920
 func nickHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
1920
 func nickHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
1921
 	if client.registered {
1921
 	if client.registered {
1922
+		if client.account == "" && server.Config().Accounts.NickReservation.ForbidAnonNickChanges {
1923
+			rb.Add(nil, server.name, ERR_UNKNOWNERROR, client.Nick(), client.t("You may not change your nickname"))
1924
+			return false
1925
+		}
1922
 		performNickChange(server, client, client, nil, msg.Params[0], rb)
1926
 		performNickChange(server, client, client, nil, msg.Params[0], rb)
1923
 	} else {
1927
 	} else {
1924
 		client.preregNick = msg.Params[0]
1928
 		client.preregNick = msg.Params[0]

Laden…
Annuleren
Opslaan