forked from External/ergo
fix double application of guest prefix
This commit is contained in:
parent
5d9a03f031
commit
ca3be51028
1 changed files with 11 additions and 2 deletions
|
|
@ -151,10 +151,19 @@ func (clients *ClientManager) SetNick(client *Client, session *Session, newNick
|
||||||
}
|
}
|
||||||
|
|
||||||
if account == "" && config.Accounts.NickReservation.ForceGuestFormat {
|
if account == "" && config.Accounts.NickReservation.ForceGuestFormat {
|
||||||
|
newcfnick, err = CasefoldName(newNick)
|
||||||
|
if err != nil {
|
||||||
|
return "", errNicknameInvalid
|
||||||
|
}
|
||||||
|
if !config.Accounts.NickReservation.guestRegexpFolded.MatchString(newcfnick) {
|
||||||
newNick = strings.Replace(config.Accounts.NickReservation.GuestFormat, "*", newNick, 1)
|
newNick = strings.Replace(config.Accounts.NickReservation.GuestFormat, "*", newNick, 1)
|
||||||
|
newcfnick = "" // re-fold it below
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if newcfnick == "" {
|
||||||
newcfnick, err = CasefoldName(newNick)
|
newcfnick, err = CasefoldName(newNick)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errNicknameInvalid
|
return "", errNicknameInvalid
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue