diff --git a/client.go b/client.go index c7aed4f..4e3dccb 100644 --- a/client.go +++ b/client.go @@ -186,6 +186,8 @@ func (c *Client) reply(code replyCode, args ...string) { motd = motd[80:] } c.outputChan <- fmt.Sprintf(":%s 376 %s :End of MOTD Command", c.server.name, c.nick) + case rplPong: + c.outputChan <- fmt.Sprintf(":%s PONG %s %s", c.server.name, c.nick, c.server.name) 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 be57d11..478783d 100644 --- a/rosella.go +++ b/rosella.go @@ -126,6 +126,7 @@ const ( rplInfo rplVersion rplMOTD + rplPong errMoreArgs errNoNick errInvalidNick diff --git a/server.go b/server.go index c457692..f09f6b8 100644 --- a/server.go +++ b/server.go @@ -76,6 +76,8 @@ func (s *Server) handleEvent(e Event) { func (s *Server) handleCommand(client *Client, command string, args []string) { switch command { + case "PING": + client.reply(rplPong) case "INFO": client.reply(rplInfo, "Rosella IRCD github.com/eXeC64/Rosella") case "VERSION":