Просмотр исходного кода

Merge pull request #1927 from FiskFan1999/deletemessagewarn

histserv delete now requires two params
tags/v2.10.0-rc1
Shivaram Lingamneni 2 лет назад
Родитель
Сommit
ac2fc0da28
Аккаунт пользователя с таким Email не найден
1 измененных файлов: 6 добавлений и 12 удалений
  1. 6
    12
      irc/histserv.go

+ 6
- 12
irc/histserv.go Просмотреть файл

42
 		},
42
 		},
43
 		"delete": {
43
 		"delete": {
44
 			handler: histservDeleteHandler,
44
 			handler: histservDeleteHandler,
45
-			help: `Syntax: $bDELETE [target] <msgid>$b
45
+			help: `Syntax: $bDELETE <target> <msgid>$b
46
 
46
 
47
-DELETE deletes an individual message by its msgid. The target is a channel
48
-name or nickname; depending on the history implementation, this may or may not
49
-be necessary to locate the message.`,
50
-			helpShort: `$bDELETE$b deletes an individual message by its msgid.`,
47
+DELETE deletes an individual message by its msgid. The target is the channel
48
+name. The msgid is the ID as can be found in the tags of that message.`,
49
+			helpShort: `$bDELETE$b deletes an individual message by its target and msgid.`,
51
 			enabled:   histservEnabled,
50
 			enabled:   histservEnabled,
52
-			minParams: 1,
51
+			minParams: 2,
53
 			maxParams: 2,
52
 			maxParams: 2,
54
 		},
53
 		},
55
 		"export": {
54
 		"export": {
94
 }
93
 }
95
 
94
 
96
 func histservDeleteHandler(service *ircService, server *Server, client *Client, command string, params []string, rb *ResponseBuffer) {
95
 func histservDeleteHandler(service *ircService, server *Server, client *Client, command string, params []string, rb *ResponseBuffer) {
97
-	var target, msgid string
98
-	if len(params) == 1 {
99
-		msgid = params[0]
100
-	} else {
101
-		target, msgid = params[0], params[1]
102
-	}
96
+	target, msgid := params[0], params[1] // Fix #1881 2 params are required
103
 
97
 
104
 	// operators can delete; if individual delete is allowed, a chanop or
98
 	// operators can delete; if individual delete is allowed, a chanop or
105
 	// the message author can delete
99
 	// the message author can delete

Загрузка…
Отмена
Сохранить