Merge branch 'chat_bugfix' into 'develop'

Fix a bug with trying to update IRC channels when IRC is disabled.

See merge request knotteye/satyr!20
merge-requests/21/head
knotteye 2020-08-09 04:58:04 +00:00
commit 4baa07123f
1 changed files with 6 additions and 4 deletions

View File

@ -94,12 +94,14 @@ async function updateUsers() {
async function updateInteg() {
if(liveUsers.length === 0) {
chatIntegration = [];
if(config['chat']['irc']['enabled']) updateIRCChan();
if(config['chat']['twitch']['enabled']) updateTwitchChan();
return;
}
if(liveUsers.length === 1) {
chatIntegration = await db.query('SELECT * FROM chat_integration WHERE username='+db.raw.escape(liveUsers[0]['username']));
updateIRCChan();
updateTwitchChan();
if(config['chat']['irc']['enabled']) updateIRCChan();
if(config['chat']['twitch']['enabled']) updateTwitchChan();
return;
}
var qs: string;
@ -108,8 +110,8 @@ async function updateInteg() {
}
qs = qs.substring(0, qs.length - 13);
chatIntegration = await db.query('SELECT * FROM chat_integration WHERE username='+qs);
updateIRCChan();
updateTwitchChan();
if(config['chat']['irc']['enabled']) updateIRCChan();
if(config['chat']['twitch']['enabled']) updateTwitchChan();
}
async function sendAll(user: string, msg: Array<string>, src: string) {