Skip to content

Commit 71a3e75

Browse files
committed
fix: Fixed ghost mentions in send text message
1 parent a2448ea commit 71a3e75

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* Added group membership validation before sending message to groups
1616
* Adjusts in Dockerfile
1717
* Adjusts in returns in endpoints chatwoot and webhook
18+
* Fixed ghost mentions in send text message
1819

1920
# 1.2.2 (2023-07-15 09:36)
2021

src/whatsapp/services/whatsapp.service.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ export class WAStartupService {
343343
public async sendDataWebhook<T = any>(event: Events, data: T, local = true) {
344344
const webhookGlobal = this.configService.get<Webhook>('WEBHOOK');
345345
const webhookLocal = this.localWebhook.events;
346+
const serverUrl = this.configService.get<HttpServer>('SERVER').URL;
346347
const we = event.replace(/[\.-]/gm, '_').toUpperCase();
347348
const transformedWe = we.replace(/_/gm, '-').toLowerCase();
348349
const instance = this.configService.get<Auth>('AUTHENTICATION').INSTANCE;
@@ -366,6 +367,7 @@ export class WAStartupService {
366367
instance: this.instance.name,
367368
data,
368369
destination: this.localWebhook.url,
370+
server_url: serverUrl,
369371
});
370372
}
371373

@@ -377,6 +379,7 @@ export class WAStartupService {
377379
instance: this.instance.name,
378380
data,
379381
destination: this.localWebhook.url,
382+
server_url: serverUrl,
380383
});
381384
}
382385
} catch (error) {
@@ -390,6 +393,7 @@ export class WAStartupService {
390393
stack: error?.stack,
391394
name: error?.name,
392395
url: baseURL,
396+
server_url: serverUrl,
393397
});
394398
}
395399
}
@@ -424,6 +428,7 @@ export class WAStartupService {
424428
instance: this.instance.name,
425429
data,
426430
destination: localUrl,
431+
server_url: serverUrl,
427432
});
428433
}
429434

@@ -435,6 +440,7 @@ export class WAStartupService {
435440
instance: this.instance.name,
436441
data,
437442
destination: localUrl,
443+
server_url: serverUrl,
438444
});
439445
}
440446
} catch (error) {
@@ -448,6 +454,7 @@ export class WAStartupService {
448454
stack: error?.stack,
449455
name: error?.name,
450456
url: globalURL,
457+
server_url: serverUrl,
451458
});
452459
}
453460
}
@@ -1508,6 +1515,7 @@ export class WAStartupService {
15081515
sender,
15091516
{
15101517
text: message['conversation'],
1518+
mentions,
15111519
} as unknown as AnyMessageContent,
15121520
option as unknown as MiscMessageGenerationOptions,
15131521
);

0 commit comments

Comments
 (0)