From 87684f7eabff708ce730968ad02b51a2d194c30a Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 16 Mar 2020 14:32:38 +0100 Subject: [PATCH] Don't reply to PING when client is unregistered --- downstream.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/downstream.go b/downstream.go index b39687d..eb51e6a 100644 --- a/downstream.go +++ b/downstream.go @@ -303,13 +303,6 @@ func (dc *downstreamConn) handleMessage(msg *irc.Message) error { switch msg.Command { case "QUIT": return dc.Close() - case "PING": - dc.SendMessage(&irc.Message{ - Prefix: dc.srv.prefix(), - Command: "PONG", - Params: msg.Params, - }) - return nil default: if dc.registered { return dc.handleMessageRegistered(msg) @@ -510,6 +503,13 @@ func (dc *downstreamConn) runUntilRegistered() error { func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { switch msg.Command { + case "PING": + dc.SendMessage(&irc.Message{ + Prefix: dc.srv.prefix(), + Command: "PONG", + Params: msg.Params, + }) + return nil case "USER": return ircError{&irc.Message{ Command: irc.ERR_ALREADYREGISTERED,