Skip to content

Commit f246516

Browse files
committed
fix: fixed issue where CSAT opened a new ticket when reopen_conversation was disabled
1 parent c296bf4 commit f246516

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* Added restart instance when update profile picture
2727
* Correction of chatwoot functioning with admin flows
2828
* Fixed problem that did not generate qrcode with the chatwoot_conversation_pending option enabled
29+
* Fixed issue where CSAT opened a new ticket when reopen_conversation was disabled
2930

3031
### Integrations
3132

src/whatsapp/services/chatwoot.service.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,11 @@ export class ChatwootService {
14581458
this.logger.verbose('get conversation message');
14591459
const bodyMessage = await this.getConversationMessage(body.message);
14601460

1461+
if (bodyMessage.includes('Por favor, classifique esta conversa, http')) {
1462+
this.logger.verbose('conversation is closed');
1463+
return;
1464+
}
1465+
14611466
const isMedia = this.isMediaMessage(body.message);
14621467

14631468
const adsMessage = this.getAdsMessage(body.message);

src/whatsapp/services/whatsapp.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1777,7 +1777,7 @@ export class WAStartupService {
17771777
this.logger.verbose('Sending data to webhook in event MESSAGES_UPSERT');
17781778
this.sendDataWebhook(Events.MESSAGES_UPSERT, messageRaw);
17791779

1780-
if (this.localChatwoot.enabled) {
1780+
if (this.localChatwoot.enabled && !received.key.id.includes('@broadcast')) {
17811781
const chatwootSentMessage = await this.chatwootService.eventWhatsapp(
17821782
Events.MESSAGES_UPSERT,
17831783
{ instanceName: this.instance.name },

0 commit comments

Comments
 (0)