Reply to PING commands with PONG
This commit is contained in:
parent
860073fbf3
commit
6b011ef8c3
@ -186,6 +186,8 @@ func (c *Client) reply(code replyCode, args ...string) {
|
|||||||
motd = motd[80:]
|
motd = motd[80:]
|
||||||
}
|
}
|
||||||
c.outputChan <- fmt.Sprintf(":%s 376 %s :End of MOTD Command", c.server.name, c.nick)
|
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:
|
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:
|
||||||
|
@ -126,6 +126,7 @@ const (
|
|||||||
rplInfo
|
rplInfo
|
||||||
rplVersion
|
rplVersion
|
||||||
rplMOTD
|
rplMOTD
|
||||||
|
rplPong
|
||||||
errMoreArgs
|
errMoreArgs
|
||||||
errNoNick
|
errNoNick
|
||||||
errInvalidNick
|
errInvalidNick
|
||||||
|
@ -76,6 +76,8 @@ func (s *Server) handleEvent(e Event) {
|
|||||||
func (s *Server) handleCommand(client *Client, command string, args []string) {
|
func (s *Server) handleCommand(client *Client, command string, args []string) {
|
||||||
|
|
||||||
switch command {
|
switch command {
|
||||||
|
case "PING":
|
||||||
|
client.reply(rplPong)
|
||||||
case "INFO":
|
case "INFO":
|
||||||
client.reply(rplInfo, "Rosella IRCD github.com/eXeC64/Rosella")
|
client.reply(rplInfo, "Rosella IRCD github.com/eXeC64/Rosella")
|
||||||
case "VERSION":
|
case "VERSION":
|
||||||
|
Loading…
Reference in New Issue
Block a user