From eb830e11b79cd71cc460f92a43264e567ba6de88 Mon Sep 17 00:00:00 2001 From: OpSimple <35542206+OpSimple@users.noreply.github.com> Date: Fri, 1 Jun 2018 03:42:25 +0530 Subject: Added an extra loop for allies Added an extra loop so as to deliver the muzzled user's texts to all of the allies --- server/src/commands/core/chat.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/src/commands/core/chat.js b/server/src/commands/core/chat.js index 86f69c3..db23a28 100644 --- a/server/src/commands/core/chat.js +++ b/server/src/commands/core/chat.js @@ -50,6 +50,12 @@ exports.run = async (core, server, socket, data) => { if(core.muzzledHashes[socket.hash]){ server.broadcast( payload, { channel: socket.channel, hash: socket.hash }); + if(core.muzzledHashes[socket.hash].allies){ + let aqs = core.muzzledHashes[socket.hash].allies; + for(let i=0; i < aqs.length; i++){ + server.broadcast( payload, { channel: socket.channel, nick: aqs[i] }); + } + } } else { //else send it to everyone server.broadcast( payload, { channel: socket.channel}); -- cgit v1.2.1