Skip to content

Commit 374cf8e

Browse files
authored
Merge pull request #2053 from slingamn/killmsg
tweak KILL message
2 parents 3fca52b + eb83df4 commit 374cf8e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

irc/handlers.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ func kickHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respons
14451445
// KILL <nickname> <comment>
14461446
func killHandler(server *Server, client *Client, msg ircmsg.Message, rb *ResponseBuffer) bool {
14471447
nickname := msg.Params[0]
1448-
comment := "<no reason supplied>"
1448+
var comment string
14491449
if len(msg.Params) > 1 {
14501450
comment = msg.Params[1]
14511451
}
@@ -1458,9 +1458,18 @@ func killHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respons
14581458
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()))
14591459
}
14601460

1461-
quitMsg := fmt.Sprintf("Killed (%s (%s))", client.nick, comment)
1461+
quitMsg := "Killed"
1462+
if comment != "" {
1463+
quitMsg = fmt.Sprintf("Killed by %s: %s", client.Nick(), comment)
1464+
}
14621465

1463-
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))
1466+
var snoLine string
1467+
if comment == "" {
1468+
snoLine = fmt.Sprintf(ircfmt.Unescape("%s was killed by %s"), target.Nick(), client.Nick())
1469+
} else {
1470+
snoLine = fmt.Sprintf(ircfmt.Unescape("%s was killed by %s $c[grey][$r%s$c[grey]]"), target.Nick(), client.Nick(), comment)
1471+
}
1472+
server.snomasks.Send(sno.LocalKills, snoLine)
14641473

14651474
target.Quit(quitMsg, nil)
14661475
target.destroy(nil)

0 commit comments

Comments
 (0)