diff --git a/irc/client.go b/irc/client.go index 4f4f4cb0..59d06f3e 100644 --- a/irc/client.go +++ b/irc/client.go @@ -398,8 +398,10 @@ func (client *Client) run(session *Session) { } } - // DoS hardening, #505 - if !client.registered { + if client.registered { + session.fakelag.Touch() + } else { + // DoS hardening, #505 session.registrationMessages++ if client.server.Config().Limits.RegistrationMessages < session.registrationMessages { client.Send(nil, client.server.name, ERR_UNKNOWNERROR, "*", client.t("You have sent too many registration messages")) diff --git a/irc/commands.go b/irc/commands.go index c7e16b2b..38d50c66 100644 --- a/irc/commands.go +++ b/irc/commands.go @@ -39,10 +39,6 @@ func (cmd *Command) Run(server *Server, client *Client, session *Session, msg ir return false } - if client.registered { - session.fakelag.Touch() - } - rb := NewResponseBuffer(session) rb.Label = GetLabel(msg) exiting := cmd.handler(server, client, msg, rb)