mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-22 11:59:40 +01:00
Merge pull request #1776 from ProgVal/kick-default-comment
Make kick messages default to the kicker name instead of the kicked
This commit is contained in:
commit
0d438dd0d6
@ -1373,6 +1373,9 @@ func kickHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respons
|
|||||||
if len(msg.Params) > 2 {
|
if len(msg.Params) > 2 {
|
||||||
comment = msg.Params[2]
|
comment = msg.Params[2]
|
||||||
}
|
}
|
||||||
|
if comment == "" {
|
||||||
|
comment = client.Nick()
|
||||||
|
}
|
||||||
for _, kick := range kicks {
|
for _, kick := range kicks {
|
||||||
channel := server.channels.Get(kick.channel)
|
channel := server.channels.Get(kick.channel)
|
||||||
if channel == nil {
|
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"))
|
rb.Add(nil, server.name, ERR_NOSUCHNICK, client.nick, utils.SafeErrorParam(kick.nick), client.t("No such nick"))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if comment == "" {
|
|
||||||
comment = kick.nick
|
|
||||||
}
|
|
||||||
channel.Kick(client, target, comment, rb, hasPrivs)
|
channel.Kick(client, target, comment, rb, hasPrivs)
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user