mirror of
https://github.com/ergochat/ergo.git
synced 2025-01-03 08:32:43 +01:00
fix double application of guest prefix
This commit is contained in:
parent
5d9a03f031
commit
ca3be51028
@ -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…
Reference in New Issue
Block a user