mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 09:51:24 -06:00
fix: Added group membership validation before sending message to groups
This commit is contained in:
parent
b9eb8d45b2
commit
c00f132145
@ -7,6 +7,7 @@
|
|||||||
* Fixed in the postman collection the webhookByEvent parameter by webhook_by_events
|
* Fixed in the postman collection the webhookByEvent parameter by webhook_by_events
|
||||||
* Now it's getting the API URL directly in the request, no longer need the variable in the env file
|
* Now it's getting the API URL directly in the request, no longer need the variable in the env file
|
||||||
* Removed link preview endpoint, now it's done automatically from sending conventional text
|
* Removed link preview endpoint, now it's done automatically from sending conventional text
|
||||||
|
* Added group membership validation before sending message to groups
|
||||||
|
|
||||||
# 1.2.2 (2023-07-15 09:36)
|
# 1.2.2 (2023-07-15 09:36)
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
SendAudioDto,
|
SendAudioDto,
|
||||||
SendButtonDto,
|
SendButtonDto,
|
||||||
SendContactDto,
|
SendContactDto,
|
||||||
SendLinkPreviewDto,
|
|
||||||
SendListDto,
|
SendListDto,
|
||||||
SendLocationDto,
|
SendLocationDto,
|
||||||
SendMediaDto,
|
SendMediaDto,
|
||||||
|
@ -1434,6 +1434,12 @@ export class WAStartupService {
|
|||||||
let mentions: string[];
|
let mentions: string[];
|
||||||
if (isJidGroup(sender)) {
|
if (isJidGroup(sender)) {
|
||||||
try {
|
try {
|
||||||
|
const groupMetadata = await this.client.groupMetadata(sender);
|
||||||
|
|
||||||
|
if (!groupMetadata) {
|
||||||
|
throw new NotFoundException('Group not found');
|
||||||
|
}
|
||||||
|
|
||||||
if (options?.mentions) {
|
if (options?.mentions) {
|
||||||
this.logger.verbose('Mentions defined');
|
this.logger.verbose('Mentions defined');
|
||||||
|
|
||||||
@ -1448,7 +1454,6 @@ export class WAStartupService {
|
|||||||
this.logger.verbose('Mentions everyone');
|
this.logger.verbose('Mentions everyone');
|
||||||
|
|
||||||
this.logger.verbose('Getting group metadata');
|
this.logger.verbose('Getting group metadata');
|
||||||
const groupMetadata = await this.client.groupMetadata(sender);
|
|
||||||
mentions = groupMetadata.participants.map((participant) => participant.id);
|
mentions = groupMetadata.participants.map((participant) => participant.id);
|
||||||
this.logger.verbose('Getting group metadata for mentions');
|
this.logger.verbose('Getting group metadata for mentions');
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user