3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-23 11:12:44 +01:00

Merge pull request #1927 from FiskFan1999/deletemessagewarn

histserv delete now requires two params
This commit is contained in:
Shivaram Lingamneni 2022-04-02 21:27:13 -04:00 committed by GitHub
commit ac2fc0da28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,14 +42,13 @@ FORGET deletes all history messages sent by an account.`,
},
"delete": {
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
name or nickname; depending on the history implementation, this may or may not
be necessary to locate the message.`,
helpShort: `$bDELETE$b deletes an individual message by its msgid.`,
DELETE deletes an individual message by its msgid. The target is the channel
name. The msgid is the ID as can be found in the tags of that message.`,
helpShort: `$bDELETE$b deletes an individual message by its target and msgid.`,
enabled: histservEnabled,
minParams: 1,
minParams: 2,
maxParams: 2,
},
"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) {
var target, msgid string
if len(params) == 1 {
msgid = params[0]
} else {
target, msgid = params[0], params[1]
}
target, msgid := params[0], params[1] // Fix #1881 2 params are required
// operators can delete; if individual delete is allowed, a chanop or
// the message author can delete