From 856f995c28ad1e23bec4e606b94a3f8446109323 Mon Sep 17 00:00:00 2001 From: Benjamin Auder <benjamin.auder@somewhere> Date: Mon, 9 Mar 2020 10:38:53 +0100 Subject: [PATCH] Implement notifyAllBut() --- server/sockets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/sockets.js b/server/sockets.js index f3224f1f..7395af15 100644 --- a/server/sockets.js +++ b/server/sockets.js @@ -42,10 +42,10 @@ module.exports = function(wss) { }); }; // For focus events: no need to target self - const notifyAllButMe = (page,code,obj={}) => { + const notifyAllBut = (page,code,obj={},except) => { if (!clients[page]) return; Object.keys(clients[page]).forEach(k => { - if (k == sid) return; + if (except.includes(k)) return; Object.keys(clients[page][k]).forEach(x => { send( clients[page][k][x].socket, -- 2.44.0