KILL: Make reason optional, to match other ircds

This commit is contained in:
Daniel Oaks 2016-09-14 20:57:33 +10:00
parent c9a82e3f6f
commit 969eed394f
2 changed files with 5 additions and 2 deletions

View File

@ -85,7 +85,7 @@ var Commands = map[string]Command{
},
"KILL": {
handler: killHandler,
minParams: 2,
minParams: 1,
oper: true,
},
"LIST": {

View File

@ -1117,7 +1117,10 @@ func timeHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
// KILL <nickname> <comment>
func killHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
nickname := msg.Params[0]
comment := msg.Params[1]
comment := "<no reason supplied>"
if len(msg.Params) > 1 {
comment = msg.Params[1]
}
target := server.clients.Get(Name(nickname))
if target == nil {