lintageddon 6

This commit is contained in:
Josh Burman 2020-02-04 15:08:27 -05:00
parent 7c20b25faf
commit bf91bb1b5a
4 changed files with 8 additions and 5 deletions

View File

@ -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);

View File

@ -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) {

View File

@ -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 {

View File

@ -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) {