3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-15 00:19:29 +01:00
RPL_ENDOFWHO should send the original, un-normalized mask
This commit is contained in:
Shivaram Lingamneni 2021-11-14 13:41:27 -05:00
parent 92f6bf2d03
commit 62b2d0341e

View File

@ -3328,12 +3328,15 @@ func (client *Client) rplWhoReply(channel *Channel, target *Client, rb *Response
// WHO <mask> [<filter>%<fields>,<type>] // WHO <mask> [<filter>%<fields>,<type>]
func whoHandler(server *Server, client *Client, msg ircmsg.Message, rb *ResponseBuffer) bool { func whoHandler(server *Server, client *Client, msg ircmsg.Message, rb *ResponseBuffer) bool {
mask := msg.Params[0] origMask := utils.SafeErrorParam(msg.Params[0])
var err error if origMask != msg.Params[0] {
if mask == "" { rb.Add(nil, server.name, ERR_UNKNOWNERROR, client.Nick(), "WHO", client.t("First param must be a mask or channel"))
rb.Add(nil, server.name, ERR_UNKNOWNERROR, client.nick, "WHO", client.t("First param must be a mask or channel"))
return false return false
} else if mask[0] == '#' { }
mask := origMask
var err error
if mask[0] == '#' {
mask, err = CasefoldChannel(msg.Params[0]) mask, err = CasefoldChannel(msg.Params[0])
} else { } else {
mask, err = CanonicalizeMaskWildcard(mask) mask, err = CanonicalizeMaskWildcard(mask)
@ -3430,7 +3433,7 @@ func whoHandler(server *Server, client *Client, msg ircmsg.Message, rb *Response
} }
} }
rb.Add(nil, server.name, RPL_ENDOFWHO, client.nick, mask, client.t("End of WHO list")) rb.Add(nil, server.name, RPL_ENDOFWHO, client.nick, origMask, client.t("End of WHO list"))
return false return false
} }