1
0
Fork 0
forked from External/ergo

client: Fix a lot of bugs around setting NICK

This commit is contained in:
Daniel Oaks 2016-11-29 22:33:10 +10:00
parent 5eafd2656e
commit a8eabe8e9c
3 changed files with 19 additions and 24 deletions

View file

@ -658,13 +658,6 @@ func userHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
return true
}
// set user info and log client in
//TODO(dan): Could there be a race condition here with adding/removing the client?
//TODO(dan): we should do something like server.clients.Replace(client) instead
// we do it this way to ONLY replace what hasn't already been set
server.clients.Remove(client)
if !client.HasUsername() {
client.username = "~" + msg.Params[0]
// don't bother updating nickmask here, it's not valid anyway
@ -673,7 +666,6 @@ func userHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
client.realname = msg.Params[3]
}
server.clients.Add(client)
server.tryRegister(client)
return false