aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorOpSimple <35542206+OpSimple@users.noreply.github.com>2018-05-31 21:48:18 +0200
committerGitHub <noreply@github.com>2018-05-31 21:48:18 +0200
commit60246bc2fb4968e8bba3a2cc5eba244c826a694f (patch)
treecd651916c6ecaf2225b45a43efc9b546b3e8f648 /server
parentCreated speak.js (diff)
downloadhackchat-60246bc2fb4968e8bba3a2cc5eba244c826a694f.tar.gz
hackchat-60246bc2fb4968e8bba3a2cc5eba244c826a694f.zip
Added checking for muzzled user
Diffstat (limited to '')
-rw-r--r--server/src/commands/core/chat.js9
1 files 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
+};