From 680898b56bf63f1b99a30e6cbad8ac0d35fddfd2 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Thu, 17 Jan 2019 20:13:49 -0700 Subject: [PATCH] Add minutes used to logoff event --- core/client_connections.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/client_connections.js b/core/client_connections.js index 33f1df8a..21aa5c1c 100644 --- a/core/client_connections.js +++ b/core/client_connections.js @@ -120,7 +120,8 @@ function removeClient(client) { ); if(client.user && client.user.isValid()) { - Events.emit(Events.getSystemEvents().UserLogoff, { user : client.user } ); + const minutesOnline = moment().diff(moment(client.user.properties[UserProps.LastLoginTs]), 'minutes'); + Events.emit(Events.getSystemEvents().UserLogoff, { user : client.user, minutesOnline } ); } Events.emit(