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:], " ") reason := strings.Join(args[1:], " ")
if client, exists := s.clientMap[strings.ToLower(nick)]; exists { client, exists := s.clientMap[strings.ToLower(nick)]
client.reply(rplKill, e.client.nick, reason) if !exists {
client.disconnect()
} else {
e.client.reply(errNoSuchNick, nick) e.client.reply(errNoSuchNick, nick)
return
} }
client.reply(rplKill, e.client.nick, reason)
client.disconnect()
case command == "KICK": case command == "KICK":
if e.client.registered == false { if e.client.registered == false {
e.client.reply(errNotReg) e.client.reply(errNotReg)