Skip to content

Commit

Permalink
Merge pull request #1790 from slingamn/unknowncommand
Browse files Browse the repository at this point in the history
fix #1530
  • Loading branch information
slingamn authored Sep 6, 2021
2 parents 585910a + ffb5e4f commit d02eecd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion irc/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3531,7 +3531,15 @@ func zncHandler(server *Server, client *Client, msg ircmsg.Message, rb *Response

// fake handler for unknown commands
func unknownCommandHandler(server *Server, client *Client, msg ircmsg.Message, rb *ResponseBuffer) bool {
rb.Add(nil, server.name, ERR_UNKNOWNCOMMAND, client.Nick(), utils.SafeErrorParam(msg.Command), client.t("Unknown command"))
var message string
if strings.HasPrefix(msg.Command, "/") {
message = fmt.Sprintf(client.t("Unknown command; if you are using /QUOTE, the correct syntax is /QUOTE %s, not /QUOTE %s"),
strings.TrimPrefix(msg.Command, "/"), msg.Command)
} else {
message = client.t("Unknown command")
}

rb.Add(nil, server.name, ERR_UNKNOWNCOMMAND, client.Nick(), utils.SafeErrorParam(msg.Command), message)
return false
}

Expand Down
2 changes: 1 addition & 1 deletion irctest

0 comments on commit d02eecd

Please sign in to comment.