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

histserv delete now requires two params

This commit is contained in:
William Rehwinkel 2022-04-01 20:52:09 -04:00
parent 9f6e26450b
commit 934ad1cec2

View File

@ -42,14 +42,13 @@ FORGET deletes all history messages sent by an account.`,
}, },
"delete": { "delete": {
handler: histservDeleteHandler, handler: histservDeleteHandler,
help: `Syntax: $bDELETE [target] <msgid>$b help: `Syntax: $bDELETE <target> <msgid>$b
DELETE deletes an individual message by its msgid. The target is a channel DELETE deletes an individual message by its msgid. The target is the channel
name or nickname; depending on the history implementation, this may or may not name. The msgid is the ID as can be found in the tags of that message.`,
be necessary to locate the message.`, helpShort: `$bDELETE$b deletes an individual message by its target and msgid.`,
helpShort: `$bDELETE$b deletes an individual message by its msgid.`,
enabled: histservEnabled, enabled: histservEnabled,
minParams: 1, minParams: 2,
maxParams: 2, maxParams: 2,
}, },
"export": { "export": {
@ -94,12 +93,7 @@ func histservForgetHandler(service *ircService, server *Server, client *Client,
} }
func histservDeleteHandler(service *ircService, server *Server, client *Client, command string, params []string, rb *ResponseBuffer) { func histservDeleteHandler(service *ircService, server *Server, client *Client, command string, params []string, rb *ResponseBuffer) {
var target, msgid string target, msgid := params[0], params[1] // Fix #1881 2 params are required
if len(params) == 1 {
msgid = params[0]
} else {
target, msgid = params[0], params[1]
}
// operators can delete; if individual delete is allowed, a chanop or // operators can delete; if individual delete is allowed, a chanop or
// the message author can delete // the message author can delete