fix(basic.gblib): update ChatServices.ts #420

Closed
eltociear wants to merge 2540 commits from patch-1 into main
Showing only changes of commit 796ad85fb7 - Show all commits

View file

@ -1046,14 +1046,18 @@ export class WhatsappDirectLine extends GBService {
let urlMin: any = GBServer.globals.minInstances.filter(p => p.instance.botId === botId)[0]; let urlMin: any = GBServer.globals.minInstances.filter(p => p.instance.botId === botId)[0];
let user = await sec.ensureUser(urlMin, id, '', '', 'omnichannel', '','');
let user = await sec.getUserFromSystemId(id);
const botNumber = urlMin ? urlMin.core.getParam(urlMin.instance, 'Bot Number', null) : null; const botNumber = urlMin ? urlMin.core.getParam(urlMin.instance, 'Bot Number', null) : null;
if (botNumber && GBServer.globals.minBoot.botId !== urlMin.botId) { if (botNumber && GBServer.globals.minBoot.botId !== urlMin.botId) {
GBLog.info(`${user.userSystemId} fixed by bot number talked to: ${botId}.`); GBLog.info(`${id} fixed by bot number talked to: ${botId}.`);
user = await sec.updateUserInstance(user.userSystemId, urlMin.instance.instanceId);
user = await sec.ensureUser(urlMin, id, '', '', 'omnichannel', '','');
user = await sec.updateUserInstance(id, urlMin.instance.instanceId);
} }
let activeMin; let activeMin;
// Processes group behaviour. // Processes group behaviour.