diff --git a/TODO.txt b/TODO.txt index 597695d..520526d 100644 --- a/TODO.txt +++ b/TODO.txt @@ -56,6 +56,8 @@ REF https://www.alien.net.au/irc/irc2numerics.html +http://faerion.sourceforge.net/doc/irc/whox.var + http://www.anta.net/misc/telnet-troubleshooting/irc.shtml https://tools.ietf.org/html/rfc2812 diff --git a/server.go b/server.go index 565ab45..5c4254d 100644 --- a/server.go +++ b/server.go @@ -330,6 +330,19 @@ func (s *Server) handleRegisteredCommand(command string, args []string) { s.DisconnectClient() } + default: + s.handleJoinedCommand(command, args) + } +} + +func (s *Server) handleJoinedCommand(command string, args []string) { + + if s.clientState != CSJoined { + s.reply(errNotReg) + return + } + + switch command { case "PART": if len(args) < 1 { s.reply(errMoreArgs)