3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 03:49:27 +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": { "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