mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
fix error for METADATA CLEAR
This commit is contained in:
parent
96b9bca2d2
commit
cd0b6e3d0a
1 changed files with 2 additions and 5 deletions
|
|
@ -3112,9 +3112,6 @@ func metadataHandler(server *Server, client *Client, msg ircmsg.Message, rb *Res
|
||||||
|
|
||||||
subcommand := strings.ToLower(msg.Params[1])
|
subcommand := strings.ToLower(msg.Params[1])
|
||||||
|
|
||||||
invalidTarget := func() {
|
|
||||||
rb.Add(nil, server.name, "FAIL", "METADATA", "INVALID_TARGET", target, client.t("Invalid metadata target"))
|
|
||||||
}
|
|
||||||
noKeyPerms := func(key string) {
|
noKeyPerms := func(key string) {
|
||||||
rb.Add(nil, server.name, "FAIL", "METADATA", "KEY_NO_PERMISSION", target, key, client.t("You do not have permission to perform this action"))
|
rb.Add(nil, server.name, "FAIL", "METADATA", "KEY_NO_PERMISSION", target, key, client.t("You do not have permission to perform this action"))
|
||||||
}
|
}
|
||||||
|
|
@ -3140,7 +3137,7 @@ func metadataHandler(server *Server, client *Client, msg ircmsg.Message, rb *Res
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if targetObj == nil {
|
if targetObj == nil {
|
||||||
invalidTarget()
|
rb.Add(nil, server.name, "FAIL", "METADATA", "INVALID_TARGET", target, client.t("Invalid metadata target"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3229,7 +3226,7 @@ func metadataHandler(server *Server, client *Client, msg ircmsg.Message, rb *Res
|
||||||
|
|
||||||
case "clear":
|
case "clear":
|
||||||
if !metadataCanIEditThisTarget(client, targetObj) {
|
if !metadataCanIEditThisTarget(client, targetObj) {
|
||||||
invalidTarget()
|
noKeyPerms("*")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue