From aeaaddc8ab53ae313c3aca687ada2fd5504398c5 Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Wed, 31 Aug 2022 23:29:14 -0300 Subject: [PATCH] fix(whatsapp.gblib): .gbapp message subprocessing. --- packages/whatsapp.gblib/services/WhatsappDirectLine.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts index 1b4ffd7d..bb710d79 100644 --- a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts +++ b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts @@ -124,7 +124,10 @@ export class WhatsappDirectLine extends GBService { const gbaiName = `${this.min.botId}.gbai`; let localName = Path.join('work', gbaiName, 'profile'); let client = this.customClient = new Client({ - authStrategy: new LocalAuth(), + authStrategy: new LocalAuth({ + clientId: this.min.botId, + dataPath: localName + }), puppeteer: { headless: false, args: ['--disable-features=site-per-process', `--user-data-dir=${localName}`] @@ -398,7 +401,7 @@ export class WhatsappDirectLine extends GBService { // Processes .gbapp message interception. await CollectionUtil.asyncForEach(this.min.appPackages, async (e: IGBPackage) => { - await e.onExchangeData(this.min, 'whatsappMessage', req.body.messages ? req.body.messages[0] : message); + await e.onExchangeData(this.min, 'whatsappMessage', { from, fromName }); }); const sec = new SecService();