fix APISocketServer not getting language channel messages

This commit is contained in:
HF 2022-01-14 02:11:12 +01:00
parent 8f4e1c83b0
commit 2f13771dba
2 changed files with 4 additions and 2 deletions

View File

@ -19,6 +19,7 @@ export class ChatProvider {
constructor() { constructor() {
this.defaultChannels = {}; this.defaultChannels = {};
this.langChannels = {}; this.langChannels = {};
this.publicChannelIds = [];
this.enChannelId = 0; this.enChannelId = 0;
this.infoUserId = 1; this.infoUserId = 1;
this.eventUserId = 1; this.eventUserId = 1;
@ -102,6 +103,7 @@ export class ChatProvider {
type, type,
lastTs, lastTs,
]; ];
this.publicChannelIds.push(id);
} }
// find or create non-english lang channels // find or create non-english lang channels
const langs = Object.keys(ttags); const langs = Object.keys(ttags);
@ -123,6 +125,7 @@ export class ChatProvider {
type, type,
lastTs, lastTs,
}; };
this.publicChannelIds.push(id);
} }
// find or create default users // find or create default users
let name = INFO_USER_NAME; let name = INFO_USER_NAME;

View File

@ -101,8 +101,7 @@ class APISocketServer {
return; return;
} }
// send only messages from default and lang channels // send only messages from default and lang channels
if (!chatProvider.defaultChannels[channelId] if (!chatProvider.publicChannelIds.includes(channelId)) {
&& !chatProvider.langChannels[channelId]) {
return; return;
} }