|
@@ -400,6 +400,13 @@ func userHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
400
|
400
|
return false
|
401
|
401
|
}
|
402
|
402
|
|
|
403
|
+ // confirm that username is valid
|
|
404
|
+ //
|
|
405
|
+ if !Name(msg.Params[0]).IsNickname() {
|
|
406
|
+ client.Send(nil, "", "ERROR", "Malformed username")
|
|
407
|
+ return true
|
|
408
|
+ }
|
|
409
|
+
|
403
|
410
|
// set user info and log client in
|
404
|
411
|
//TODO(dan): Could there be a race condition here with adding/removing the client?
|
405
|
412
|
//TODO(dan): we should do something like server.clients.Replace(client) instead
|