lintageddon 6
This commit is contained in:
parent
7c20b25faf
commit
bf91bb1b5a
@ -57,7 +57,9 @@ class ChannelManager {
|
||||
|
||||
createByChannelType(data: any) {
|
||||
try {
|
||||
logger.accessLog.info(`attempting to create channel of type ${data.channel_type}, channel id: ${data.channel}...`);
|
||||
logger.accessLog.info(
|
||||
`attempting to create channel of type ${data.channel_type}, channel id: ${data.channel}...`
|
||||
);
|
||||
|
||||
if (data.channel_type === 'public') {
|
||||
return new PublicChannel(data.channel);
|
||||
|
@ -27,7 +27,7 @@ class ClientManager {
|
||||
}
|
||||
|
||||
clientsOfType(client_type: string) {
|
||||
let result: PublicClient[]|PrivateClient[]|CustomClient[] = [];
|
||||
const result: PublicClient[]|PrivateClient[]|CustomClient[] = [];
|
||||
|
||||
for (const client of this.clients) {
|
||||
if (client.type() === client_type) {
|
||||
|
@ -3,7 +3,7 @@ import * as express from 'express';
|
||||
|
||||
const app = require('./config/app');
|
||||
const corsOptions = {
|
||||
origin: (origin: string, callback: Function) => {
|
||||
origin: (origin: string, callback: (error: any, success?: boolean) => void) => {
|
||||
if (app.whitelist.indexOf(origin) !== -1) {
|
||||
callback(null, true);
|
||||
} else {
|
||||
|
@ -26,6 +26,7 @@ function connectionManager() {
|
||||
ws.close();
|
||||
} else {
|
||||
const data = result.data;
|
||||
var client: PublicClient|PrivateClient|CustomClient|null;
|
||||
logger.accessLog.info(`Client Connected: ${data.user_id}`);
|
||||
|
||||
if (!channelManager.channelExists(data.channel)) {
|
||||
@ -33,13 +34,13 @@ function connectionManager() {
|
||||
}
|
||||
|
||||
if (clientManager.clientExists(data.user_id)) {
|
||||
var client: PublicClient|PrivateClient|CustomClient|null = clientManager.getClient(data.user_id);
|
||||
client = clientManager.getClient(data.user_id);
|
||||
|
||||
if (client != null) {
|
||||
client.replaceWebSocket(ws);
|
||||
}
|
||||
} else {
|
||||
var client: PublicClient|PrivateClient|CustomClient|null = clientManager.addClient(data, channelManager, ws);
|
||||
client = clientManager.addClient(data, channelManager, ws);
|
||||
}
|
||||
|
||||
if (client != null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user