mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2026-01-09 13:22:21 -06:00
feat(chatwoot): show edited messages from WhatsApp in Chatwoot
This commit is contained in:
@@ -937,6 +937,17 @@ export class BaileysStartupService extends WAStartupService {
|
||||
try {
|
||||
this.logger.verbose('Event received: messages.upsert');
|
||||
for (const received of messages) {
|
||||
if (
|
||||
this.localChatwoot.enabled &&
|
||||
(received.message?.protocolMessage?.editedMessage || received.message?.editedMessage?.message)
|
||||
) {
|
||||
const editedMessage =
|
||||
received.message?.protocolMessage || received.message?.editedMessage?.message?.protocolMessage;
|
||||
if (editedMessage) {
|
||||
this.chatwootService.eventWhatsapp('messages.edit', { instanceName: this.instance.name }, editedMessage);
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
(type !== 'notify' && type !== 'append') ||
|
||||
received.message?.protocolMessage ||
|
||||
|
||||
Reference in New Issue
Block a user