1
0
Fork 0
forked from External/ergo

strings: Fix nick bugs, use UsernameCaseMapped

This commit is contained in:
Daniel Oaks 2017-01-14 02:32:15 +10:00
parent c6e8e4bef3
commit 2b240faa90
4 changed files with 13 additions and 10 deletions

View file

@ -397,11 +397,11 @@ func (client *Client) SetNickname(nickname string) error {
// ChangeNickname changes the existing nickname of the client.
func (client *Client) ChangeNickname(nickname string) error {
origNickMask := client.nickMaskString
client.updateNickMask()
err := client.server.clients.Replace(client.nick, nickname, client)
if err == nil {
client.server.whoWas.Append(client)
client.nick = nickname
client.updateNickMask()
for friend := range client.Friends() {
friend.Send(nil, origNickMask, "NICK", nickname)
}