diff --git a/src/core/ChatProvider.js b/src/core/ChatProvider.js index c3962c8..776dc76 100644 --- a/src/core/ChatProvider.js +++ b/src/core/ChatProvider.js @@ -19,6 +19,7 @@ export class ChatProvider { constructor() { this.defaultChannels = {}; this.langChannels = {}; + this.publicChannelIds = []; this.enChannelId = 0; this.infoUserId = 1; this.eventUserId = 1; @@ -102,6 +103,7 @@ export class ChatProvider { type, lastTs, ]; + this.publicChannelIds.push(id); } // find or create non-english lang channels const langs = Object.keys(ttags); @@ -123,6 +125,7 @@ export class ChatProvider { type, lastTs, }; + this.publicChannelIds.push(id); } // find or create default users let name = INFO_USER_NAME; diff --git a/src/socket/APISocketServer.js b/src/socket/APISocketServer.js index a257707..2ab4663 100644 --- a/src/socket/APISocketServer.js +++ b/src/socket/APISocketServer.js @@ -101,8 +101,7 @@ class APISocketServer { return; } // send only messages from default and lang channels - if (!chatProvider.defaultChannels[channelId] - && !chatProvider.langChannels[channelId]) { + if (!chatProvider.publicChannelIds.includes(channelId)) { return; }