Skip to content

Commit 2f3d6f7

Browse files
committed
fix: Fixed problem with fileSha256 appearing when sending a sticker in chatwoot
1 parent a73d5f4 commit 2f3d6f7

4 files changed

Lines changed: 14 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
### Fixed
1212

1313
* Added link preview option in send text message
14+
* Fixed problem with fileSha256 appearing when sending a sticker in chatwoot
1415

1516
### Integrations
1617

src/validate/validate.schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ export const whatsappNumberSchema: JSONSchema7 = {
446446
uniqueItems: true,
447447
items: {
448448
type: 'string',
449-
pattern: '^\\d+',
449+
// pattern: '^\\d+',
450450
description: '"numbers" must be an array of numeric strings',
451451
},
452452
},

src/whatsapp/services/chatwoot.service.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,10 @@ export class ChatwootService {
11731173

11741174
const result = typeKey ? types[typeKey] : undefined;
11751175

1176+
if (typeKey === 'stickerMessage') {
1177+
return null;
1178+
}
1179+
11761180
if (typeKey === 'contactMessage') {
11771181
const vCardData = result.split('\n');
11781182
const contactInfo = {};
@@ -1295,6 +1299,8 @@ export class ChatwootService {
12951299
this.logger.verbose('get conversation message');
12961300
const bodyMessage = await this.getConversationMessage(body.message);
12971301

1302+
console.log('bodyMessage', bodyMessage, body.message);
1303+
12981304
if (!bodyMessage && !isMedia) {
12991305
this.logger.warn('no body message found');
13001306
return;

src/whatsapp/services/whatsapp.service.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1335,9 +1335,14 @@ export class WAStartupService {
13351335

13361336
if (settings?.msg_call.trim().length > 0 && call.status == 'offer') {
13371337
this.logger.verbose('Sending message in call');
1338-
this.client.sendMessage(call.from, {
1338+
const msg = await this.client.sendMessage(call.from, {
13391339
text: settings.msg_call,
13401340
});
1341+
1342+
this.client.ev.emit('messages.upsert', {
1343+
messages: [msg],
1344+
type: 'notify',
1345+
});
13411346
}
13421347
}
13431348

0 commit comments

Comments
 (0)