From b6cdb51f002353bb49f0beb8d03b05dce779f975 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Wed, 23 Oct 2019 11:32:32 -0400 Subject: [PATCH] fix #652 --- irc/handlers.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/irc/handlers.go b/irc/handlers.go index 82077aa7..e5ac2a5e 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -2660,19 +2660,20 @@ func webircHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Re // WHO [ [o]] func whoHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool { - if msg.Params[0] == "" { + mask := msg.Params[0] + var err error + if mask == "" { rb.Add(nil, server.name, ERR_UNKNOWNERROR, client.nick, "WHO", client.t("First param must be a mask or channel")) return false + } else if mask[0] == '#' { + mask, err = CasefoldChannel(msg.Params[0]) + } else { + mask, err = Casefold(mask) } - var mask string - if len(msg.Params) > 0 { - casefoldedMask, err := Casefold(msg.Params[0]) - if err != nil { - rb.Add(nil, server.name, ERR_UNKNOWNERROR, client.Nick(), "WHO", client.t("Mask isn't valid")) - return false - } - mask = casefoldedMask + if err != nil { + rb.Add(nil, server.name, ERR_UNKNOWNERROR, client.Nick(), "WHO", client.t("Mask isn't valid")) + return false } //TODO(dan): is this used and would I put this param in the Modern doc?