From f33f41b0ebf31b094ba5bcdcc08b746687ab0fdc Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Fri, 13 Aug 2021 19:33:56 +0200 Subject: [PATCH] Make kick messages default to the kicker name instead of the kicked For consistency with RFC2812, Bahamut, Hybrid, Insp, Plexus4, Unreal. https://datatracker.ietf.org/doc/html/rfc2812#section-3.2.8 At the expense of consistency with chary/solanum, irc2, and ircu2. --- irc/handlers.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/irc/handlers.go b/irc/handlers.go index 7a269647..a956af10 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -1373,6 +1373,9 @@ func kickHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respons if len(msg.Params) > 2 { comment = msg.Params[2] } + if comment == "" { + comment = client.Nick() + } for _, kick := range kicks { channel := server.channels.Get(kick.channel) if channel == nil { @@ -1385,10 +1388,6 @@ func kickHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respons rb.Add(nil, server.name, ERR_NOSUCHNICK, client.nick, utils.SafeErrorParam(kick.nick), client.t("No such nick")) continue } - - if comment == "" { - comment = kick.nick - } channel.Kick(client, target, comment, rb, hasPrivs) } return false