mirror of
https://github.com/ergochat/ergo.git
synced 2025-01-03 16:42:38 +01:00
fix #1476
enable the use of grouped nicks as account names for SASL, if force-nick-equals-account is disabled
This commit is contained in:
parent
f2a40b9e5d
commit
bafadf3aac
@ -1041,6 +1041,21 @@ func (am *AccountManager) SetNickReserved(client *Client, nick string, saUnreser
|
|||||||
|
|
||||||
func (am *AccountManager) checkPassphrase(accountName, passphrase string) (account ClientAccount, err error) {
|
func (am *AccountManager) checkPassphrase(accountName, passphrase string) (account ClientAccount, err error) {
|
||||||
account, err = am.LoadAccount(accountName)
|
account, err = am.LoadAccount(accountName)
|
||||||
|
// #1476: if grouped nicks are allowed, attempt to interpret accountName as a grouped nick
|
||||||
|
if err == errAccountDoesNotExist && !am.server.Config().Accounts.NickReservation.ForceNickEqualsAccount {
|
||||||
|
cfnick, cfErr := CasefoldName(accountName)
|
||||||
|
if cfErr != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
accountName = func() string {
|
||||||
|
am.RLock()
|
||||||
|
defer am.RUnlock()
|
||||||
|
return am.nickToAccount[cfnick]
|
||||||
|
}()
|
||||||
|
if accountName != "" {
|
||||||
|
account, err = am.LoadAccount(accountName)
|
||||||
|
}
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user