From 75f89a9f1fb860bef97d8f90952beee305050b18 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sun, 25 Apr 2021 17:16:34 -0400 Subject: [PATCH] fix FAIL REGISTER INVALID_USERNAME case --- irc/handlers.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/irc/handlers.go b/irc/handlers.go index 63ccd682..5f28816f 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -2528,8 +2528,9 @@ func registerHandler(server *Server, client *Client, msg ircmsg.Message, rb *Res } // check that accountName is valid as a non-final parameter; // this is necessary for us to be valid and it will prevent us from emitting invalid error lines - if accountName == "*" || accountName != utils.SafeErrorParam(accountName) { - rb.Add(nil, server.name, "FAIL", "REGISTER", "INVALID_USERNAME", accountName, client.t("Username invalid or not given")) + nickErrorParam := utils.SafeErrorParam(accountName) + if accountName == "*" || accountName != nickErrorParam { + rb.Add(nil, server.name, "FAIL", "REGISTER", "INVALID_USERNAME", nickErrorParam, client.t("Username invalid or not given")) return }