1
0
mirror of https://github.com/hack-chat/main.git synced 2024-03-22 13:20:33 +08:00
This commit is contained in:
marzavec 2020-11-06 14:12:36 -08:00
parent 22772fa90c
commit 85b9ad08bb

View File

@ -80,15 +80,14 @@ export async function run({
// Announce the kicked clients arrival in destChannel and that they were kicked
// Before they arrive, so they don't see they got moved
const moveAnnouncement = {
...getUserDetails(socket),
...{
cmd: 'onlineAdd',
channel: destChannel, // @todo Multichannel
},
};
for (let i = 0; i < kicked.length; i += 1) {
server.broadcast(moveAnnouncement, { channel: destChannel });
server.broadcast({
...getUserDetails(kicked[i]),
...{
cmd: 'onlineAdd',
channel: destChannel, // @todo Multichannel
},
}, { channel: destChannel });
}
// Move all kicked clients to the new channel