From 830fc8f61280d1f4971cf750fa32ff2347ac69d1 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Fri, 30 Aug 2013 23:17:54 +0100 Subject: [PATCH] Added /INFO command --- client.go | 2 ++ rosella.go | 1 + server.go | 2 ++ 3 files changed, 5 insertions(+) diff --git a/client.go b/client.go index 273dbb2..96149f4 100644 --- a/client.go +++ b/client.go @@ -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: diff --git a/rosella.go b/rosella.go index 30dc42f..70b771c 100644 --- a/rosella.go +++ b/rosella.go @@ -109,6 +109,7 @@ const ( rplOper rplChannelModeIs rplKick + rplInfo errMoreArgs errNoNick errInvalidNick diff --git a/server.go b/server.go index d07492c..663adf4 100644 --- a/server.go +++ b/server.go @@ -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)