mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 10:42:52 +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 {
|
||||
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)
|
||||
newcfnick = "" // re-fold it below
|
||||
}
|
||||
}
|
||||
|
||||
if newcfnick == "" {
|
||||
newcfnick, err = CasefoldName(newNick)
|
||||
}
|
||||
if err != nil {
|
||||
return "", errNicknameInvalid
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user