Skip to content

Commit

Permalink
fix(whtsapp): correção de mensagem via bot.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldurans committed Jul 24, 2022
1 parent fe60e70 commit 14f747c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
16 changes: 16 additions & 0 deletions backend/src/services/ChatFlowServices/BuildSendMessageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ const BuildSendMessageService = async ({
lastMessageAt: new Date().getTime()
});

global.rabbitWhatsapp.publishInQueue(
`whatsapp::${tenantId}`,
JSON.stringify({
...messageCreated.toJSON(),
contact: ticket.contact.toJSON()
})
);

socketEmit({
tenantId,
type: "chat:create",
Expand Down Expand Up @@ -150,6 +158,14 @@ const BuildSendMessageService = async ({
answered: true
});

global.rabbitWhatsapp.publishInQueue(
`whatsapp::${tenantId}`,
JSON.stringify({
...messageCreated.toJSON(),
contact: ticket.contact.toJSON()
})
);

socketEmit({
tenantId,
type: "chat:create",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ const CreateMessageSystemService = async ({
lastMessageAt: new Date().getTime()
});

global.rabbitWhatsapp.publishInQueue(
`whatsapp::${tenantId}`,
JSON.stringify({
...messageCreated.toJSON(),
contact: ticket.contact.toJSON()
})
);

socketEmit({
tenantId,
type: "chat:create",
Expand Down

0 comments on commit 14f747c

Please sign in to comment.