isolate command processing

--HG--
branch : nmdc-ircfrontend
This commit is contained in:
. 2016-05-07 19:09:45 +12:00
parent 287e3ce0cf
commit 4ec2881cee
2 changed files with 15 additions and 0 deletions

View File

@ -56,6 +56,8 @@ REF
https://www.alien.net.au/irc/irc2numerics.html 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 http://www.anta.net/misc/telnet-troubleshooting/irc.shtml
https://tools.ietf.org/html/rfc2812 https://tools.ietf.org/html/rfc2812

View File

@ -330,6 +330,19 @@ func (s *Server) handleRegisteredCommand(command string, args []string) {
s.DisconnectClient() 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": case "PART":
if len(args) < 1 { if len(args) < 1 {
s.reply(errMoreArgs) s.reply(errMoreArgs)