3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 03:49:27 +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 committed by Shivaram Lingamneni
parent 37fbf4c4dd
commit a24b31cbd6

View File

@ -1334,6 +1334,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 {
@ -1346,10 +1349,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