3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 11:59:40 +01:00

Merge pull request #1790 from slingamn/unknowncommand

fix #1530
This commit is contained in:
Shivaram Lingamneni 2021-09-05 20:32:06 -04:00 committed by GitHub
commit d02eecd8ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -3531,7 +3531,15 @@ func zncHandler(server *Server, client *Client, msg ircmsg.Message, rb *Response
// fake handler for unknown commands // fake handler for unknown commands
func unknownCommandHandler(server *Server, client *Client, msg ircmsg.Message, rb *ResponseBuffer) bool { 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 return false
} }

@ -1 +1 @@
Subproject commit 125a1cc106655b8c34705fd74a2704fccb8ec91e Subproject commit f86e11a288a88e2016d579c7a4bbb3c58869f879