Added /INFO command

This commit is contained in:
Harry Jeffery 2013-08-30 23:17:54 +01:00
parent 42c068b4bf
commit 830fc8f612
3 changed files with 5 additions and 0 deletions

View File

@ -171,6 +171,8 @@ func (c *Client) reply(code replyCode, args ...string) {
c.outputChan <- fmt.Sprintf(":%s 324 %s %s %s %s", c.server.name, c.nick, args[0], args[1], args[2])
case rplKick:
c.outputChan <- fmt.Sprintf(":%s KICK %s %s %s", args[0], args[1], args[2], args[3])
case rplInfo:
c.outputChan <- fmt.Sprintf(":%s 371 %s :%s", c.server.name, c.nick, args[0])
case errMoreArgs:
c.outputChan <- fmt.Sprintf(":%s 461 %s :Not enough params", c.server.name, c.nick)
case errNoNick:

View File

@ -109,6 +109,7 @@ const (
rplOper
rplChannelModeIs
rplKick
rplInfo
errMoreArgs
errNoNick
errInvalidNick

View File

@ -62,6 +62,8 @@ func (s *Server) handleEvent(e Event) {
args := fields[1:]
switch {
case command == "INFO":
e.client.reply(rplInfo, "Rosella IRCD github.com/eXeC64/Rosella")
case command == "NICK":
if len(args) < 1 {
e.client.reply(errNoNick)