aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorOpSimple <35542206+OpSimple@users.noreply.github.com>2018-06-01 00:12:25 +0200
committerGitHub <noreply@github.com>2018-06-01 00:12:25 +0200
commiteb830e11b79cd71cc460f92a43264e567ba6de88 (patch)
tree9d41b0b2c4b06d5ca70dfa2b9ad1a5411672e8d5 /server
parentAdded an extra option to add allies (diff)
downloadhackchat-eb830e11b79cd71cc460f92a43264e567ba6de88.tar.gz
hackchat-eb830e11b79cd71cc460f92a43264e567ba6de88.zip
Added an extra loop for allies
Added an extra loop so as to deliver the muzzled user's texts to all of the allies
Diffstat (limited to 'server')
-rw-r--r--server/src/commands/core/chat.js6
1 files changed, 6 insertions, 0 deletions
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});