From ce208cb3e1a6153891dd327a6735d64f9950d08a Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Tue, 25 Feb 2020 13:26:49 -0500 Subject: [PATCH] fix #814 --- irc/commands.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/irc/commands.go b/irc/commands.go index cddcb8a4..a899b571 100644 --- a/irc/commands.go +++ b/irc/commands.go @@ -54,22 +54,18 @@ func (cmd *Command) Run(server *Server, client *Client, session *Session, msg ir return cmd.handler(server, client, msg, rb) }() + // after each command, see if we can send registration to the client + if !exiting && !client.registered { + exiting = server.tryRegister(client, session) + } + // most servers do this only for PING/PONG, but we'll do it for any command: if client.registered { // touch even if `exiting`, so we record the time of a QUIT accurately session.idletimer.Touch() } - if exiting { - return - } - - // after each command, see if we can send registration to the client - if !client.registered { - exiting = server.tryRegister(client, session) - } - - if client.registered && !cmd.leaveClientIdle { + if !exiting && client.registered && !cmd.leaveClientIdle { client.Active(session) }