From 447a7e183cb6090ecff532f79f94a4759c2ca3fe Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 7 Mar 2024 10:58:25 +0100 Subject: [PATCH] Use latest chainpad-server and its updated events --- lib/historyKeeper.js | 9 ++++++++- package.json | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/historyKeeper.js b/lib/historyKeeper.js index 6d6ba56e0..ad1e0d2cf 100644 --- a/lib/historyKeeper.js +++ b/lib/historyKeeper.js @@ -105,8 +105,15 @@ module.exports.create = function (Env, cb) { cb("ERESTRICTED", allowed); }); }, - sessionClose: function (userId, reason) { + sessionClose: function (userId, reason, ip) { HK.closeNetfluxSession(Env, userId); + if (Env.logIP) { + return void Log.info('USER_DISCONNECTED', { + userId: userId, + reason: reason, + ip: ip, + }); + } if (['BAD_MESSAGE', 'SEND_MESSAGE_FAIL_2'].indexOf(reason) !== -1) { if (reason && reason.code === 'ECONNRESET') { return; } return void Log.error('SESSION_CLOSE_WITH_ERROR', { diff --git a/package.json b/package.json index a3f6a090f..b0460c4d8 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "dependencies": { "@mcrowe/minibloom": "^0.2.0", "chainpad-crypto": "^0.2.5", - "chainpad-server": "^5.1.0", + "chainpad-server": "^5.2.0", "cookie-parser": "^1.4.6", "body-parser": "^1.20.2", "express": "~4.18.2",