Moved server-side queue transmission to it's own protected namespace.

This commit is contained in:
rainbow napkin 2025-10-22 05:00:59 -04:00
parent 5eb307bb9e
commit 6d16ac2353
5 changed files with 28 additions and 11 deletions

View file

@ -1607,7 +1607,18 @@ class queue{
* @param {Mongoose.Document} chanDB - Pass through Channel Document to save on DB Transactions
*/
async broadcastQueue(chanDB){
this.server.io.in(this.channel.name).emit('queue',{queue: await this.prepQueue(chanDB)});
//Broadcast queue to authenticated sockets within the channels room inside the protected 'queue-broadcast' namespace
this.server.queueBroadcastManager.namespace.in(this.channel.name).emit('queue',{queue: await this.prepQueue(chanDB)});
}
/**
* Broadcasts channel queue to a single socket
* @param {Mongoose.Document} chanDB - Pass through Channel Document to save on DB Transactions
* @param {Socket} socket - Socket to send queue to
*/
async emitQueue(chanDB, socket){
//Broadcast queue to authenticated sockets within the channels room inside the protected 'queue-broadcast' namespace
socket.emit('queue',{queue: await this.prepQueue(chanDB)});
}
/**