mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-11 06:29:29 +01:00
fix an edge case with /NS SASET user always-on true
If force-nick-equals-account is disabled, then this could cause a client with a non-reserved (or grouped) nick to become always-on. (This can't happen with `/NS SET always-on true` because we check in advance.)
This commit is contained in:
parent
d9cab88780
commit
470756cd3e
@ -330,6 +330,8 @@ func (client *Client) SetAccountSettings(settings AccountSettings) {
|
||||
alwaysOn := persistenceEnabled(client.server.Config().Accounts.Multiclient.AlwaysOn, settings.AlwaysOn)
|
||||
client.stateMutex.Lock()
|
||||
if client.registered {
|
||||
// only allow the client to become always-on if their nick equals their account name
|
||||
alwaysOn = alwaysOn && client.nick == client.accountName
|
||||
autoreplayMissedDisabled = (client.accountSettings.AutoreplayMissed && !settings.AutoreplayMissed)
|
||||
becameAlwaysOn = (!client.alwaysOn && alwaysOn)
|
||||
client.alwaysOn = alwaysOn
|
||||
|
Loading…
Reference in New Issue
Block a user