Small tidy up in Server.handleEvent()

This commit is contained in:
Harry Jeffery 2013-08-31 18:44:25 +01:00
parent 0426b39846
commit df9ece79e3

View File

@ -323,13 +323,15 @@ func (s *Server) handleEvent(e Event) {
reason := strings.Join(args[1:], " ")
if client, exists := s.clientMap[strings.ToLower(nick)]; exists {
client.reply(rplKill, e.client.nick, reason)
client.disconnect()
} else {
client, exists := s.clientMap[strings.ToLower(nick)]
if !exists {
e.client.reply(errNoSuchNick, nick)
return
}
client.reply(rplKill, e.client.nick, reason)
client.disconnect()
case command == "KICK":
if e.client.registered == false {
e.client.reply(errNotReg)