Small tidy up in Server.handleEvent()
This commit is contained in:
parent
0426b39846
commit
df9ece79e3
10
server.go
10
server.go
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user