3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-14 07:59:31 +01: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:
Shivaram Lingamneni 2019-02-05 17:50:13 -05:00 committed by GitHub
commit 8eefe869d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2469,8 +2469,14 @@ func userHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Resp
err := client.SetNames(msg.Params[0], msg.Params[3], false) err := client.SetNames(msg.Params[0], msg.Params[3], false)
if err == errInvalidUsername { if err == errInvalidUsername {
// 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")) rb.Add(nil, server.name, ERR_INVALIDUSERNAME, client.t("Malformed username"))
} }
}
return false return false
} }