Created dedicated queue broadcast namespace, to make authorized queue broadcasts as painless as possible.
This commit is contained in:
parent
e88ef29852
commit
5eb307bb9e
9 changed files with 131 additions and 9 deletions
|
|
@ -19,6 +19,7 @@ const auxServer = require('../auxServer');
|
|||
const chatPreprocessor = require('../chatPreprocessor');
|
||||
const loggerUtils = require("../../utils/loggerUtils");
|
||||
const message = require("./message");
|
||||
const socketUtils = require("../../utils/socketUtils");
|
||||
|
||||
/**
|
||||
* Class containg global server-side private message relay logic
|
||||
|
|
@ -41,10 +42,10 @@ class pmHandler extends auxServer{
|
|||
*/
|
||||
async handleConnection(socket){
|
||||
//Check if we're properly authorized
|
||||
const authorized = await super.handleConnection(socket, "${user}");
|
||||
const authorized = await super.handleConnection(socket);
|
||||
|
||||
//If we're authorized
|
||||
if(authorized){
|
||||
if(authorized != null){
|
||||
//Throw the user into their own unique channel
|
||||
socket.join(socket.user.user);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue