mirror of
https://github.com/jeremyd/ergo.git
synced 2026-06-15 17:11:54 -07:00
Merge pull request #350 from oragono/unicode-usernames-fix
Set uninteresting username if user's using a special nick
This commit is contained in:
+7
-1
@@ -2469,7 +2469,13 @@ func userHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Resp
|
||||
|
||||
err := client.SetNames(msg.Params[0], msg.Params[3], false)
|
||||
if err == errInvalidUsername {
|
||||
rb.Add(nil, server.name, ERR_INVALIDUSERNAME, client.t("Malformed username"))
|
||||
// if client's using a unicode nick or something weird, let's just set 'em up with a stock username instead.
|
||||
// fixes clients that just use their nick as a username so they can still use the interesting nick
|
||||
if client.preregNick == msg.Params[0] {
|
||||
client.SetNames("user", msg.Params[3], false)
|
||||
} else {
|
||||
rb.Add(nil, server.name, ERR_INVALIDUSERNAME, client.t("Malformed username"))
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user