From eb83df420b9a36a342757920c2f67e081b647b59 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 27 Feb 2023 03:22:38 -0500 Subject: [PATCH] tweak KILL message Remove ``, make default KILL anonymous --- irc/handlers.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/irc/handlers.go b/irc/handlers.go index 6dae89ed..0b5ebf96 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -1445,7 +1445,7 @@ func kickHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respons // KILL func killHandler(server *Server, client *Client, msg ircmsg.Message, rb *ResponseBuffer) bool { nickname := msg.Params[0] - comment := "" + var comment string if len(msg.Params) > 1 { comment = msg.Params[1] } @@ -1458,9 +1458,18 @@ func killHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respons rb.Add(nil, client.server.name, ERR_UNKNOWNERROR, client.Nick(), "KILL", fmt.Sprintf(client.t("Client %s is always-on and cannot be fully removed by /KILL; consider /NS SUSPEND instead"), target.Nick())) } - quitMsg := fmt.Sprintf("Killed (%s (%s))", client.nick, comment) + quitMsg := "Killed" + if comment != "" { + quitMsg = fmt.Sprintf("Killed by %s: %s", client.Nick(), comment) + } - server.snomasks.Send(sno.LocalKills, fmt.Sprintf(ircfmt.Unescape("%s$r was killed by %s $c[grey][$r%s$c[grey]]"), target.nick, client.nick, comment)) + var snoLine string + if comment == "" { + snoLine = fmt.Sprintf(ircfmt.Unescape("%s was killed by %s"), target.Nick(), client.Nick()) + } else { + snoLine = fmt.Sprintf(ircfmt.Unescape("%s was killed by %s $c[grey][$r%s$c[grey]]"), target.Nick(), client.Nick(), comment) + } + server.snomasks.Send(sno.LocalKills, snoLine) target.Quit(quitMsg, nil) target.destroy(nil)