diff options
Diffstat (limited to 'server/src/commands/core')
-rw-r--r-- | server/src/commands/core/chat.js | 12 | ||||
-rw-r--r-- | server/src/commands/core/join.js | 3 |
2 files changed, 12 insertions, 3 deletions
diff --git a/server/src/commands/core/chat.js b/server/src/commands/core/chat.js index bce6adb..80241d5 100644 --- a/server/src/commands/core/chat.js +++ b/server/src/commands/core/chat.js @@ -48,7 +48,15 @@ exports.run = async (core, server, socket, data) => { payload.trip = socket.trip; } - server.broadcast( payload, { channel: socket.channel }); + if(core.muzzledHashes && core.muzzledHashes[socket.hash]){ + server.broadcast( payload, { channel: socket.channel, hash: socket.hash }); + if(core.muzzledHashes[socket.hash].allies){ + server.broadcast( payload, { channel: socket.channel, nick: core.muzzledHashes[socket.hash].allies }); + } + } else { + //else send it to everyone + server.broadcast( payload, { channel: socket.channel}); + } core.managers.stats.increment('messages-sent'); }; @@ -59,4 +67,4 @@ exports.info = { name: 'chat', usage: 'chat {text}', description: 'Broadcasts passed `text` field to the calling users channel' -};
\ No newline at end of file +}; diff --git a/server/src/commands/core/join.js b/server/src/commands/core/join.js index f2b2c9d..4875b0e 100644 --- a/server/src/commands/core/join.js +++ b/server/src/commands/core/join.js @@ -115,6 +115,7 @@ exports.run = async (core, server, socket, data) => { socket.uType = uType; socket.nick = nick; socket.channel = channel; + socket.hash = server.getSocketHash(socket); if (trip !== null) socket.trip = trip; nicks.push(socket.nick); @@ -132,4 +133,4 @@ exports.info = { name: 'join', usage: 'join {channel} {nick}', description: 'Place calling socket into target channel with target nick & broadcast event to channel' -};
\ No newline at end of file +}; |