mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-26 13:59:44 +01:00
commit
9495362785
@ -2660,19 +2660,20 @@ func webircHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Re
|
|||||||
|
|
||||||
// WHO [<mask> [o]]
|
// WHO [<mask> [o]]
|
||||||
func whoHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
|
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"))
|
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, err = CasefoldChannel(msg.Params[0])
|
||||||
|
} else {
|
||||||
|
mask, err = Casefold(mask)
|
||||||
}
|
}
|
||||||
|
|
||||||
var mask string
|
if err != nil {
|
||||||
if len(msg.Params) > 0 {
|
rb.Add(nil, server.name, ERR_UNKNOWNERROR, client.Nick(), "WHO", client.t("Mask isn't valid"))
|
||||||
casefoldedMask, err := Casefold(msg.Params[0])
|
return false
|
||||||
if err != nil {
|
|
||||||
rb.Add(nil, server.name, ERR_UNKNOWNERROR, client.Nick(), "WHO", client.t("Mask isn't valid"))
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
mask = casefoldedMask
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO(dan): is this used and would I put this param in the Modern doc?
|
//TODO(dan): is this used and would I put this param in the Modern doc?
|
||||||
|
Loading…
Reference in New Issue
Block a user