From 4f5cd78eb0fb402cbae90666c2407dc7e9ea9880 Mon Sep 17 00:00:00 2001 From: leca Date: Wed, 13 Nov 2024 23:09:50 +0300 Subject: [PATCH] debug info --- src/utils/notify.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/notify.js b/src/utils/notify.js index 665492c..fc14b1d 100644 --- a/src/utils/notify.js +++ b/src/utils/notify.js @@ -2,6 +2,7 @@ import clients from '../index.js'; import jwt from 'jsonwebtoken'; import config from '../../config.json' with {type: "json"}; +import log from './log.js'; const notify = (token, groupId, action, item, data) => { let login = jwt.decode(token, config.secret).login @@ -18,6 +19,7 @@ const notify = (token, groupId, action, item, data) => { if (client.currentGroup == groupId) { let userIdFromToken = jwt.decode(client.token, config.secret).login.id if (userIdCurrent == userIdFromToken) return; + log.debug(`Sending user with ID ${userIdCurrent} packet "${JSON.stringify(payload)}"`) client.socket.send(JSON.stringify(payload)) } });