From 969eed394f2bd56c8a2d4d5e85d27d4bca4a6ea1 Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Wed, 14 Sep 2016 20:57:33 +1000 Subject: [PATCH] KILL: Make reason optional, to match other ircds --- irc/commands.go | 2 +- irc/server.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/irc/commands.go b/irc/commands.go index 7a3b3689..a5bb2592 100644 --- a/irc/commands.go +++ b/irc/commands.go @@ -85,7 +85,7 @@ var Commands = map[string]Command{ }, "KILL": { handler: killHandler, - minParams: 2, + minParams: 1, oper: true, }, "LIST": { diff --git a/irc/server.go b/irc/server.go index 6c3e87b7..7c6f284e 100644 --- a/irc/server.go +++ b/irc/server.go @@ -1117,7 +1117,10 @@ func timeHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool { // KILL func killHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool { nickname := msg.Params[0] - comment := msg.Params[1] + comment := "" + if len(msg.Params) > 1 { + comment = msg.Params[1] + } target := server.clients.Get(Name(nickname)) if target == nil {