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]) c.outputChan <- fmt.Sprintf(":%s 324 %s %s %s %s", c.server.name, c.nick, args[0], args[1], args[2])
case rplKick: case rplKick:
c.outputChan <- fmt.Sprintf(":%s KICK %s %s %s", args[0], args[1], args[2], args[3]) 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: case errMoreArgs:
c.outputChan <- fmt.Sprintf(":%s 461 %s :Not enough params", c.server.name, c.nick) c.outputChan <- fmt.Sprintf(":%s 461 %s :Not enough params", c.server.name, c.nick)
case errNoNick: case errNoNick:

View File

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

View File

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