diff --git a/irc/client.go b/irc/client.go index 14b033e1..92886fa6 100644 --- a/irc/client.go +++ b/irc/client.go @@ -19,17 +19,15 @@ type Client struct { idleTimer *time.Timer invisible bool loginTimer *time.Timer + mutex *sync.Mutex nick string operator bool phase Phase quitTimer *time.Timer realname string - registered bool replies chan Reply server *Server socket *Socket - mutex *sync.Mutex - authorized bool username string } @@ -119,7 +117,7 @@ func (c *Client) readCommands() { c.server.Command(m) } - if c.registered { + if c.phase == Normal { c.ConnectionClosed() } else { c.Destroy() diff --git a/irc/server.go b/irc/server.go index ee3b43af..04c54454 100644 --- a/irc/server.go +++ b/irc/server.go @@ -169,7 +169,6 @@ func (s *Server) GenerateGuestNick() string { func (s *Server) tryRegister(c *Client) { if c.HasNick() && c.HasUsername() { - c.registered = true c.phase = Normal c.loginTimer.Stop() c.Reply( @@ -250,7 +249,6 @@ func (m *PassCommand) HandleAuthServer(s *Server) { return } - client.authorized = true client.phase = Registration } diff --git a/irc/socket.go b/irc/socket.go index c77d2d2c..7f5009b3 100644 --- a/irc/socket.go +++ b/irc/socket.go @@ -111,7 +111,6 @@ func (socket *Socket) writeLines() { break } } - socket.Close() } func (socket *Socket) maybeLogWriteError(err error) bool {