Skip to content

Commit d4766f9

Browse files
committed
feat: Save picture url groups in chatwoot
1 parent 7f4c9b5 commit d4766f9

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/whatsapp/services/chatwoot.service.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ export class ChatwootService {
4343
this.logger.verbose('message cache saved');
4444
}
4545

46+
private clearMessageCache() {
47+
this.logger.verbose('clear message cache');
48+
this.messageCache.clear();
49+
this.saveMessageCache();
50+
}
51+
4652
private async getProvider(instance: InstanceDto) {
4753
this.logger.verbose('get provider to instance: ' + instance.instanceName);
4854
try {
@@ -465,7 +471,9 @@ export class ChatwootService {
465471
return null;
466472
}
467473

468-
const contactId = contact.id || contact.payload.contact.id;
474+
console.log(contact);
475+
476+
const contactId = contact.payload.id || contact.payload.contact.id;
469477

470478
if (!body.key.fromMe && contact.name === chatId && nameContact !== chatId) {
471479
this.logger.verbose('update contact name in chatwoot');
@@ -1002,6 +1010,9 @@ export class ChatwootService {
10021010
return { message: 'bot' };
10031011
}
10041012

1013+
this.logger.verbose('clear cache');
1014+
this.clearMessageCache();
1015+
10051016
this.logger.verbose('Format message to send');
10061017
let formatText: string;
10071018
if (senderName === null || senderName === undefined) {
@@ -1158,6 +1169,7 @@ export class ChatwootService {
11581169
}
11591170

11601171
if (event === 'messages.upsert') {
1172+
console.log(body);
11611173
this.logger.verbose('event messages.upsert');
11621174

11631175
if (body.key.remoteJid === 'status@broadcast') {

0 commit comments

Comments
 (0)