aboutsummaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorMinusGix <MinusGix@gmail.com>2020-03-16 16:29:42 +0100
committerMinusGix <MinusGix@gmail.com>2020-03-16 16:29:42 +0100
commitfb234bbaa7e4f3edb6fc8a5281818bda5cd367b4 (patch)
tree1712638d88f629f2c5b62aa1a76cb58b3c568768 /server/src
parentAdd command to get information about users to broadcast to clients (diff)
downloadhackchat-fb234bbaa7e4f3edb6fc8a5281818bda5cd367b4.tar.gz
hackchat-fb234bbaa7e4f3edb6fc8a5281818bda5cd367b4.zip
Make ban command broadcast information about user and banner
Diffstat (limited to 'server/src')
-rw-r--r--server/src/commands/mod/ban.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/src/commands/mod/ban.js b/server/src/commands/mod/ban.js
index b33b55e..994bc1c 100644
--- a/server/src/commands/mod/ban.js
+++ b/server/src/commands/mod/ban.js
@@ -46,12 +46,16 @@ export async function run(core, server, socket, data) {
server.broadcast({
cmd: 'info',
text: `Banned ${targetNick}`,
+ user: UAC.getUserDetails(badClient),
}, { channel: socket.channel, level: (level) => level < UAC.levels.moderator });
// notify mods
server.broadcast({
cmd: 'info',
text: `${socket.nick}#${socket.trip} banned ${targetNick} in ${socket.channel}, userhash: ${badClient.hash}`,
+ channel: socket.channel,
+ user: UAC.getUserDetails(badClient),
+ banner: UAC.getUserDetails(socket),
}, { level: UAC.isModerator });
// force connection closed