3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-15 00:19:29 +01:00

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.
This commit is contained in:
Valentin Lorentz 2021-08-13 19:33:56 +02:00
parent 5d2d4a99bc
commit f33f41b0eb

View File

@ -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