diff --git a/irc/server.go b/irc/server.go index 2e0764ea..82e00481 100644 --- a/irc/server.go +++ b/irc/server.go @@ -122,7 +122,10 @@ func (s *Server) listen(config ListenerConfig) { if DEBUG_SERVER { log.Print("Server.Accept: ", conn.RemoteAddr()) } - NewClient(s, conn) + + s.commands <- &NewClientCommand{ + conn: conn, + } } } @@ -534,3 +537,12 @@ func (msg *NoticeCommand) HandleServer(server *Server) { } target.Reply(RplNotice(client, target, msg.message)) } + +type NewClientCommand struct { + BaseCommand + conn net.Conn +} + +func (msg *NewClientCommand) HandleServer(server *Server) { + NewClient(server, conn) +}