mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 01:41:24 -06:00
fix: When conversation reopens is pending when conversation pending is true
This commit is contained in:
parent
85ca0683ed
commit
1b93aac8c5
@ -1,6 +1,7 @@
|
||||
# 1.4.6 (homolog)
|
||||
|
||||
* Fixed bug of creating new inbox by chatwoot
|
||||
* When conversation reopens is pending when conversation pending is true
|
||||
|
||||
# 1.4.5 (2023-07-26 09:32)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "evolution-api",
|
||||
"version": "1.4.5",
|
||||
"version": "1.4.6",
|
||||
"description": "Rest api for communication with WhatsApp",
|
||||
"main": "./dist/src/main.js",
|
||||
"scripts": {
|
||||
|
@ -507,6 +507,16 @@ export class ChatwootService {
|
||||
let conversation: any;
|
||||
if (this.provider.reopen_conversation) {
|
||||
conversation = contactConversations.payload.find((conversation) => conversation.inbox_id == filterInbox.id);
|
||||
|
||||
if (this.provider.conversation_pending) {
|
||||
await client.conversations.toggleStatus({
|
||||
accountId: this.provider.account_id,
|
||||
conversationId: conversation.id,
|
||||
data: {
|
||||
status: 'pending',
|
||||
},
|
||||
});
|
||||
}
|
||||
} else {
|
||||
conversation = contactConversations.payload.find(
|
||||
(conversation) => conversation.status !== 'resolved' && conversation.inbox_id == filterInbox.id,
|
||||
|
@ -695,7 +695,7 @@ export class WAStartupService {
|
||||
this.logger.verbose('Sending data to webhook in event STATUS_INSTANCE');
|
||||
this.sendDataWebhook(Events.STATUS_INSTANCE, {
|
||||
instance: this.instance.name,
|
||||
status: 'removed',
|
||||
status: 'closed',
|
||||
});
|
||||
|
||||
if (this.localChatwoot.enabled) {
|
||||
@ -704,7 +704,7 @@ export class WAStartupService {
|
||||
{ instanceName: this.instance.name },
|
||||
{
|
||||
instance: this.instance.name,
|
||||
status: 'removed',
|
||||
status: 'closed',
|
||||
},
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user