|
@@ -1015,16 +1015,17 @@ func extjwtHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Re
|
1015
|
1015
|
}
|
1016
|
1016
|
|
1017
|
1017
|
// HELP [<query>]
|
|
1018
|
+// HELPOP [<query>]
|
1018
|
1019
|
func helpHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
|
1019
|
|
- argument := strings.ToLower(strings.TrimSpace(strings.Join(msg.Params, " ")))
|
1020
|
|
-
|
1021
|
|
- if len(argument) < 1 {
|
|
1020
|
+ if len(msg.Params) == 0 {
|
1022
|
1021
|
client.sendHelp("HELPOP", client.t(`HELPOP <argument>
|
1023
|
1022
|
|
1024
|
1023
|
Get an explanation of <argument>, or "index" for a list of help topics.`), rb)
|
1025
|
1024
|
return false
|
1026
|
1025
|
}
|
1027
|
1026
|
|
|
1027
|
+ argument := strings.ToLower(strings.TrimSpace(msg.Params[0]))
|
|
1028
|
+
|
1028
|
1029
|
// handle index
|
1029
|
1030
|
if argument == "index" {
|
1030
|
1031
|
client.sendHelp("HELP", server.helpIndexManager.GetIndex(client.Languages(), client.HasMode(modes.Operator)), rb)
|
|
@@ -1035,14 +1036,12 @@ Get an explanation of <argument>, or "index" for a list of help topics.`), rb)
|
1035
|
1036
|
|
1036
|
1037
|
if exists && (!helpHandler.oper || (helpHandler.oper && client.HasMode(modes.Operator))) {
|
1037
|
1038
|
if helpHandler.textGenerator != nil {
|
1038
|
|
- client.sendHelp(strings.ToUpper(argument), helpHandler.textGenerator(client), rb)
|
|
1039
|
+ client.sendHelp(argument, helpHandler.textGenerator(client), rb)
|
1039
|
1040
|
} else {
|
1040
|
|
- client.sendHelp(strings.ToUpper(argument), client.t(helpHandler.text), rb)
|
|
1041
|
+ client.sendHelp(argument, client.t(helpHandler.text), rb)
|
1041
|
1042
|
}
|
1042
|
1043
|
} else {
|
1043
|
|
- args := msg.Params
|
1044
|
|
- args = append(args, client.t("Help not found"))
|
1045
|
|
- rb.Add(nil, server.name, ERR_HELPNOTFOUND, args...)
|
|
1044
|
+ rb.Add(nil, server.name, ERR_HELPNOTFOUND, utils.SafeErrorParam(argument), client.t("Help not found"))
|
1046
|
1045
|
}
|
1047
|
1046
|
|
1048
|
1047
|
return false
|