fix: Bug fix when connecting whatsapp does not send confirmation message

This commit is contained in:
Davidson Gomes 2023-07-18 12:47:03 -03:00
parent 44bf39f7b7
commit 7cacf7bbaf
3 changed files with 14 additions and 1 deletions

View File

@ -23,6 +23,7 @@
* Fixed problem to receive csat in chatwoot * Fixed problem to receive csat in chatwoot
* Fixed require fileName for document only in base64 for send media message * Fixed require fileName for document only in base64 for send media message
* Bug fix when sending mobile message change contact name to number in chatwoot * Bug fix when sending mobile message change contact name to number in chatwoot
* Bug fix when connecting whatsapp does not send confirmation message
# 1.2.2 (2023-07-15 09:36) # 1.2.2 (2023-07-15 09:36)

View File

@ -1457,7 +1457,8 @@ export class ChatwootService {
if (event === 'connection.update') { if (event === 'connection.update') {
this.logger.verbose('event connection.update'); this.logger.verbose('event connection.update');
if (body.state === 'open') { console.log('connection.update', body);
if (body.status === 'open') {
const msgConnection = `🚀 Conexão realizada com sucesso!`; const msgConnection = `🚀 Conexão realizada com sucesso!`;
this.logger.verbose('send message to chatwoot'); this.logger.verbose('send message to chatwoot');

View File

@ -624,6 +624,17 @@ export class WAStartupService {
CONNECTED TO WHATSAPP CONNECTED TO WHATSAPP
`.replace(/^ +/gm, ' '), `.replace(/^ +/gm, ' '),
); );
if (this.localChatwoot.enabled) {
this.chatwootService.eventWhatsapp(
Events.CONNECTION_UPDATE,
{ instanceName: this.instance.name },
{
instance: this.instance.name,
status: 'open',
},
);
}
} }
} }