mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-26 05:49:25 +01:00
fix #1337
This commit is contained in:
parent
e993672a0f
commit
a37a91694c
@ -433,6 +433,11 @@ accounts:
|
|||||||
# as equivalent for the purpose of ban/invite/exception lists.
|
# as equivalent for the purpose of ban/invite/exception lists.
|
||||||
force-nick-equals-account: false
|
force-nick-equals-account: false
|
||||||
|
|
||||||
|
# parallel setting to force-nick-equals-account: if true, this forbids
|
||||||
|
# anonymous users (i.e., users not logged into an account) to change their
|
||||||
|
# nickname after the initial connection is complete
|
||||||
|
forbid-anon-nick-changes: false
|
||||||
|
|
||||||
# multiclient controls whether oragono allows multiple connections to
|
# multiclient controls whether oragono allows multiple connections to
|
||||||
# attach to the same client/nickname identity; this is part of the
|
# attach to the same client/nickname identity; this is part of the
|
||||||
# functionality traditionally provided by a bouncer like ZNC
|
# functionality traditionally provided by a bouncer like ZNC
|
||||||
|
@ -461,6 +461,11 @@ accounts:
|
|||||||
# as equivalent for the purpose of ban/invite/exception lists.
|
# as equivalent for the purpose of ban/invite/exception lists.
|
||||||
force-nick-equals-account: true
|
force-nick-equals-account: true
|
||||||
|
|
||||||
|
# parallel setting to force-nick-equals-account: if true, this forbids
|
||||||
|
# anonymous users (i.e., users not logged into an account) to change their
|
||||||
|
# nickname after the initial connection is complete
|
||||||
|
forbid-anonymous-nick-changes: false
|
||||||
|
|
||||||
# multiclient controls whether oragono allows multiple connections to
|
# multiclient controls whether oragono allows multiple connections to
|
||||||
# attach to the same client/nickname identity; this is part of the
|
# attach to the same client/nickname identity; this is part of the
|
||||||
# functionality traditionally provided by a bouncer like ZNC
|
# functionality traditionally provided by a bouncer like ZNC
|
||||||
|
@ -274,6 +274,7 @@ type AccountConfig struct {
|
|||||||
guestRegexpFolded *regexp.Regexp
|
guestRegexpFolded *regexp.Regexp
|
||||||
ForceGuestFormat bool `yaml:"force-guest-format"`
|
ForceGuestFormat bool `yaml:"force-guest-format"`
|
||||||
ForceNickEqualsAccount bool `yaml:"force-nick-equals-account"`
|
ForceNickEqualsAccount bool `yaml:"force-nick-equals-account"`
|
||||||
|
ForbidAnonNickChanges bool `yaml:"forbid-anonymous-nick-changes"`
|
||||||
} `yaml:"nick-reservation"`
|
} `yaml:"nick-reservation"`
|
||||||
Multiclient MulticlientConfig
|
Multiclient MulticlientConfig
|
||||||
Bouncer *MulticlientConfig // # handle old name for 'multiclient'
|
Bouncer *MulticlientConfig // # handle old name for 'multiclient'
|
||||||
|
@ -1919,6 +1919,10 @@ func namesHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Res
|
|||||||
// NICK <nickname>
|
// NICK <nickname>
|
||||||
func nickHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
|
func nickHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
|
||||||
if client.registered {
|
if client.registered {
|
||||||
|
if client.account == "" && server.Config().Accounts.NickReservation.ForbidAnonNickChanges {
|
||||||
|
rb.Add(nil, server.name, ERR_UNKNOWNERROR, client.Nick(), client.t("You may not change your nickname"))
|
||||||
|
return false
|
||||||
|
}
|
||||||
performNickChange(server, client, client, nil, msg.Params[0], rb)
|
performNickChange(server, client, client, nil, msg.Params[0], rb)
|
||||||
} else {
|
} else {
|
||||||
client.preregNick = msg.Params[0]
|
client.preregNick = msg.Params[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user