3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-10 22:19:31 +01:00
This commit is contained in:
Shivaram Lingamneni 2020-02-25 13:26:49 -05:00
parent ec1a718275
commit ce208cb3e1

View File

@ -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)
}