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:]
|
||||
}
|
||||
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:
|
||||
|
@ -126,6 +126,7 @@ const (
|
||||
rplInfo
|
||||
rplVersion
|
||||
rplMOTD
|
||||
rplPong
|
||||
errMoreArgs
|
||||
errNoNick
|
||||
errInvalidNick
|
||||
|
@ -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":
|
||||
|
Loading…
Reference in New Issue
Block a user