mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 01:41:24 -06:00
fix: Adjusts in chatwoot integration
This commit is contained in:
parent
2f3d6f7e63
commit
1aa837d220
@ -12,6 +12,8 @@
|
||||
|
||||
* Added link preview option in send text message
|
||||
* Fixed problem with fileSha256 appearing when sending a sticker in chatwoot
|
||||
* Fixed issue where it was not possible to open a conversation when sent at first by me on my cell phone in chatwoot
|
||||
* Now it only updates the contact name if it is the same as the phone number in chatwoot
|
||||
|
||||
### Integrations
|
||||
|
||||
|
@ -428,10 +428,12 @@ export class ChatwootService {
|
||||
);
|
||||
|
||||
if (findParticipant) {
|
||||
if (!findParticipant.name || findParticipant.name === chatId) {
|
||||
await this.updateContact(instance, findParticipant.id, {
|
||||
name: body.pushName,
|
||||
avatar_url: picture_url.profilePictureUrl || null,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
await this.createContact(
|
||||
instance,
|
||||
@ -454,13 +456,28 @@ export class ChatwootService {
|
||||
|
||||
let contact: any;
|
||||
if (body.key.fromMe) {
|
||||
if (findContact) {
|
||||
contact = findContact;
|
||||
} else {
|
||||
contact = await this.createContact(
|
||||
instance,
|
||||
chatId,
|
||||
filterInbox.id,
|
||||
isGroup,
|
||||
nameContact,
|
||||
picture_url.profilePictureUrl || null,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (findContact) {
|
||||
if (!findContact.name || findContact.name === chatId) {
|
||||
contact = await this.updateContact(instance, findContact.id, {
|
||||
name: nameContact,
|
||||
avatar_url: picture_url.profilePictureUrl || null,
|
||||
});
|
||||
} else {
|
||||
contact = findContact;
|
||||
}
|
||||
} else {
|
||||
contact = await this.createContact(
|
||||
instance,
|
||||
@ -1299,8 +1316,6 @@ export class ChatwootService {
|
||||
this.logger.verbose('get conversation message');
|
||||
const bodyMessage = await this.getConversationMessage(body.message);
|
||||
|
||||
console.log('bodyMessage', bodyMessage, body.message);
|
||||
|
||||
if (!bodyMessage && !isMedia) {
|
||||
this.logger.warn('no body message found');
|
||||
return;
|
||||
|
@ -1093,7 +1093,7 @@ export class WAStartupService {
|
||||
|
||||
if (
|
||||
type !== 'notify' ||
|
||||
received.message?.protocolMessage ||
|
||||
// received.message?.protocolMessage ||
|
||||
received.message?.pollUpdateMessage
|
||||
) {
|
||||
this.logger.verbose('message rejected');
|
||||
|
Loading…
Reference in New Issue
Block a user