1
0
mirror of https://github.com/hack-chat/main.git synced 2024-03-22 13:20:33 +08:00

Added checking for muzzled user

This commit is contained in:
OpSimple 2018-06-01 01:18:18 +05:30 committed by GitHub
parent bf2d064679
commit 60246bc2fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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'
};
};