mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
fix: deleting a nonexistent key gets a FAIL
This commit is contained in:
parent
9c4c337393
commit
fc388573ae
1 changed files with 3 additions and 2 deletions
|
|
@ -3200,9 +3200,10 @@ func metadataRegisteredHandler(client *Client, config *Config, subcommand string
|
|||
} else {
|
||||
if updated := targetObj.DeleteMetadata(key); updated {
|
||||
notifySubscribers(server, rb.session, targetObj, target, key, "", false)
|
||||
}
|
||||
// acknowledge to the client whether or not there was a real update
|
||||
rb.Add(nil, server.name, RPL_KEYNOTSET, client.Nick(), target, key, client.t("Key deleted"))
|
||||
} else {
|
||||
rb.Add(nil, server.name, "FAIL", "METADATA", "KEY_NOT_SET", utils.SafeErrorParam(key), client.t("Metadata key not set"))
|
||||
}
|
||||
}
|
||||
|
||||
case "get":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue