Skip to content

Commit 12f7577

Browse files
enzowilliamclaude
andcommitted
fix: mentionsEveryOne always active even when set to false
- Changed truthy check to strict equality (=== true) to properly handle string values like "false" sent by clients (e.g., n8n) - Fixed validation schema property name from 'everyOne' to 'mentionsEveryOne' to match DTO and service code Fixes #2431 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent cd800f2 commit 12f7577

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2372,7 +2372,7 @@ export class BaileysStartupService extends ChannelStartupService {
23722372
throw new NotFoundException('Group not found');
23732373
}
23742374

2375-
if (options?.mentionsEveryOne) {
2375+
if (options?.mentionsEveryOne === true) {
23762376
mentions = group.participants.map((participant) => participant.id);
23772377
} else if (options?.mentioned?.length) {
23782378
mentions = options.mentioned.map((mention) => {

src/validate/message.schema.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const textMessageSchema: JSONSchema7 = {
7777
description: 'Enter a value in milliseconds',
7878
},
7979
quoted: { ...quotedOptionsSchema },
80-
everyOne: { type: 'boolean', enum: [true, false] },
80+
mentionsEveryOne: { type: 'boolean', enum: [true, false] },
8181
mentioned: {
8282
type: 'array',
8383
minItems: 1,
@@ -107,7 +107,7 @@ export const mediaMessageSchema: JSONSchema7 = {
107107
description: 'Enter a value in milliseconds',
108108
},
109109
quoted: { ...quotedOptionsSchema },
110-
everyOne: { type: 'boolean', enum: [true, false] },
110+
mentionsEveryOne: { type: 'boolean', enum: [true, false] },
111111
mentioned: {
112112
type: 'array',
113113
minItems: 1,
@@ -133,7 +133,7 @@ export const ptvMessageSchema: JSONSchema7 = {
133133
description: 'Enter a value in milliseconds',
134134
},
135135
quoted: { ...quotedOptionsSchema },
136-
everyOne: { type: 'boolean', enum: [true, false] },
136+
mentionsEveryOne: { type: 'boolean', enum: [true, false] },
137137
mentioned: {
138138
type: 'array',
139139
minItems: 1,
@@ -159,7 +159,7 @@ export const audioMessageSchema: JSONSchema7 = {
159159
description: 'Enter a value in milliseconds',
160160
},
161161
quoted: { ...quotedOptionsSchema },
162-
everyOne: { type: 'boolean', enum: [true, false] },
162+
mentionsEveryOne: { type: 'boolean', enum: [true, false] },
163163
mentioned: {
164164
type: 'array',
165165
minItems: 1,
@@ -209,7 +209,7 @@ export const stickerMessageSchema: JSONSchema7 = {
209209
description: 'Enter a value in milliseconds',
210210
},
211211
quoted: { ...quotedOptionsSchema },
212-
everyOne: { type: 'boolean', enum: [true, false] },
212+
mentionsEveryOne: { type: 'boolean', enum: [true, false] },
213213
mentioned: {
214214
type: 'array',
215215
minItems: 1,
@@ -238,7 +238,7 @@ export const locationMessageSchema: JSONSchema7 = {
238238
description: 'Enter a value in milliseconds',
239239
},
240240
quoted: { ...quotedOptionsSchema },
241-
everyOne: { type: 'boolean', enum: [true, false] },
241+
mentionsEveryOne: { type: 'boolean', enum: [true, false] },
242242
mentioned: {
243243
type: 'array',
244244
minItems: 1,
@@ -325,7 +325,7 @@ export const pollMessageSchema: JSONSchema7 = {
325325
description: 'Enter a value in milliseconds',
326326
},
327327
quoted: { ...quotedOptionsSchema },
328-
everyOne: { type: 'boolean', enum: [true, false] },
328+
mentionsEveryOne: { type: 'boolean', enum: [true, false] },
329329
mentioned: {
330330
type: 'array',
331331
minItems: 1,
@@ -382,7 +382,7 @@ export const listMessageSchema: JSONSchema7 = {
382382
description: 'Enter a value in milliseconds',
383383
},
384384
quoted: { ...quotedOptionsSchema },
385-
everyOne: { type: 'boolean', enum: [true, false] },
385+
mentionsEveryOne: { type: 'boolean', enum: [true, false] },
386386
mentioned: {
387387
type: 'array',
388388
minItems: 1,
@@ -433,7 +433,7 @@ export const buttonsMessageSchema: JSONSchema7 = {
433433
description: 'Enter a value in milliseconds',
434434
},
435435
quoted: { ...quotedOptionsSchema },
436-
everyOne: { type: 'boolean', enum: [true, false] },
436+
mentionsEveryOne: { type: 'boolean', enum: [true, false] },
437437
mentioned: {
438438
type: 'array',
439439
minItems: 1,

0 commit comments

Comments
 (0)