KILL command now accepts a reason
This commit is contained in:
parent
7fa58ebac1
commit
e0073e55fd
@ -156,7 +156,7 @@ func (c *Client) reply(code replyCode, args ...string) {
|
||||
case rplNickChange:
|
||||
c.outputChan <- fmt.Sprintf(":%s NICK %s", args[0], args[1])
|
||||
case rplKill:
|
||||
c.outputChan <- fmt.Sprintf(":%s KILL %s A %s", c.server.name, c.nick, args[0])
|
||||
c.outputChan <- fmt.Sprintf(":%s KILL %s A %s", args[0], c.nick, args[1])
|
||||
case rplMsg:
|
||||
c.outputChan <- fmt.Sprintf(":%s PRIVMSG %s %s", args[0], args[1], args[2])
|
||||
case rplList:
|
||||
|
@ -319,8 +319,10 @@ func (s *Server) handleEvent(e Event) {
|
||||
|
||||
nick := args[0]
|
||||
|
||||
reason := strings.Join(args[1:], " ")
|
||||
|
||||
if client, exists := s.clientMap[strings.ToLower(nick)]; exists {
|
||||
client.reply(rplKill, "An operator has disconnected you.")
|
||||
client.reply(rplKill, e.client.nick, reason)
|
||||
client.disconnect()
|
||||
} else {
|
||||
e.client.reply(errNoSuchNick, nick)
|
||||
|
Loading…
Reference in New Issue
Block a user