From 25098e20de4bf834b4904330b8b748ea4c465bdb Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 13 Mar 2024 16:51:22 +0100 Subject: [PATCH] lint compliance --- lib/historyKeeper.js | 4 ++-- lib/http-worker.js | 2 +- www/common/outer/support.js | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/historyKeeper.js b/lib/historyKeeper.js index 2c4756299..7178b5f76 100644 --- a/lib/historyKeeper.js +++ b/lib/historyKeeper.js @@ -103,7 +103,7 @@ module.exports.create = function (Env, cb) { cb("ERESTRICTED", allowed); }); }, - sessionClose: function (userId, reason, ip) { + sessionClose: function (userId, reason) { HK.closeNetfluxSession(Env, userId); if (Env.logIP && !['SOCKET_CLOSED', 'INACTIVITY'].includes(reason)) { return void Log.info('USER_DISCONNECTED_ERROR', { @@ -125,7 +125,7 @@ module.exports.create = function (Env, cb) { reason: reason, }); }, - sessionOpen: function (userId, ip, oo) { + sessionOpen: function (userId, ip) { if (!Env.logIP) { return; } Log.info('USER_CONNECTION', { userId: userId, diff --git a/lib/http-worker.js b/lib/http-worker.js index 83983aaba..52cdfca6b 100644 --- a/lib/http-worker.js +++ b/lib/http-worker.js @@ -198,7 +198,7 @@ const wsProxy = createProxyMiddleware({ target: proxyTarget.href, ws: true, logLevel: 'error', - onProxyReqWs: function (proxyReq, req, socket, options, head) { + onProxyReqWs: function (proxyReq, req) { proxyReq.setHeader('X-Real-Ip', req.socket.remoteAddress); }, logProvider: (p) => { diff --git a/www/common/outer/support.js b/www/common/outer/support.js index a229c536a..11bb744a3 100644 --- a/www/common/outer/support.js +++ b/www/common/outer/support.js @@ -127,7 +127,7 @@ define([ var channel = data.channel; var title = data.title; var ticket = data.ticket; - var supportKey, theirPublic, myCurve, notifKey; + var supportKey, theirPublic, myCurve; var time = +new Date(); nThen((waitFor) => { // Send ticket to the admins and call back @@ -139,7 +139,8 @@ define([ supportKey = obj.supportKey; theirPublic = obj.theirPublic; myCurve = obj.myCurve; - notifKey = obj.notifKey; + // No need for notifKey here: users can only create tickets for the + // currently used key })); }).nThen((waitFor) => { // Create ticket mailbox @@ -1118,16 +1119,15 @@ define([ let proxy = ctx.store.proxy; let edPublic = proxy.edPublic; - let supportKey; let moderators; nThen((waitFor) => { // Check if support is enabled - getKeys(ctx, false, {}, waitFor((err, obj) => { + // and update ctx.adminKeys + getKeys(ctx, false, {}, waitFor((err) => { if (err) { cb({error: err}); return void waitFor.abort(); } - supportKey = obj.theirPublic; })); }).nThen((waitFor) => { // Only admins can disable support