diff --git a/client.go b/client.go index 96149f4..f09e189 100644 --- a/client.go +++ b/client.go @@ -173,6 +173,8 @@ func (c *Client) reply(code replyCode, args ...string) { 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 rplVersion: + c.outputChan <- fmt.Sprintf(":%s 351 %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/main.go b/main.go index 2a02732..5d44550 100644 --- a/main.go +++ b/main.go @@ -20,7 +20,7 @@ func main() { flag.Parse() - log.Printf("Rosella Initialising.") + log.Printf("Rosella v%s Initialising.", VERSION) //Init rosella itself server := NewServer() diff --git a/rosella.go b/rosella.go index 70b771c..ac27e0b 100644 --- a/rosella.go +++ b/rosella.go @@ -2,6 +2,10 @@ package main import "net" +const ( + VERSION = "1.0.0" +) + type Server struct { eventChan chan Event running bool @@ -110,6 +114,7 @@ const ( rplChannelModeIs rplKick rplInfo + rplVersion errMoreArgs errNoNick errInvalidNick diff --git a/server.go b/server.go index 1b712f5..c0490d1 100644 --- a/server.go +++ b/server.go @@ -64,6 +64,8 @@ func (s *Server) handleEvent(e Event) { switch { case command == "INFO": e.client.reply(rplInfo, "Rosella IRCD github.com/eXeC64/Rosella") + case command == "VERSION": + e.client.reply(rplVersion, VERSION) case command == "NICK": if len(args) < 1 { e.client.reply(errNoNick)