From 60246bc2fb4968e8bba3a2cc5eba244c826a694f Mon Sep 17 00:00:00 2001 From: OpSimple <35542206+OpSimple@users.noreply.github.com> Date: Fri, 1 Jun 2018 01:18:18 +0530 Subject: Added checking for muzzled user --- server/src/commands/core/chat.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/src/commands/core/chat.js b/server/src/commands/core/chat.js index bce6adb..86f69c3 100644 --- a/server/src/commands/core/chat.js +++ b/server/src/commands/core/chat.js @@ -48,7 +48,12 @@ exports.run = async (core, server, socket, data) => { payload.trip = socket.trip; } - server.broadcast( payload, { channel: socket.channel }); + if(core.muzzledHashes[socket.hash]){ + server.broadcast( payload, { channel: socket.channel, hash: socket.hash }); + } else { + //else send it to everyone + server.broadcast( payload, { channel: socket.channel}); + } core.managers.stats.increment('messages-sent'); }; @@ -59,4 +64,4 @@ exports.info = { name: 'chat', usage: 'chat {text}', description: 'Broadcasts passed `text` field to the calling users channel' -}; \ No newline at end of file +}; -- cgit v1.2.1