From b0d261b305913524a38983c91a1a97a355ac7fe2 Mon Sep 17 00:00:00 2001 From: Marlon Alves Date: Sat, 11 Oct 2025 04:13:12 -0300 Subject: [PATCH] fix/media content validation --- .../channel/whatsapp/whatsapp.baileys.service.ts | 5 ++++- src/api/services/channel.service.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 93bd321c..a1032cbc 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -3676,7 +3676,10 @@ export class BaileysStartupService extends ChannelStartupService { } } - if ('messageContextInfo' in msg.message && Object.keys(msg.message).length === 1) { + if ( + Object.keys(msg.message).length === 1 && + Object.prototype.hasOwnProperty.call(msg.message, 'messageContextInfo') + ) { throw 'The message is messageContextInfo'; } diff --git a/src/api/services/channel.service.ts b/src/api/services/channel.service.ts index 033a3224..947f9c39 100644 --- a/src/api/services/channel.service.ts +++ b/src/api/services/channel.service.ts @@ -826,7 +826,7 @@ export class ChannelStartupService { const msg = message.message; // Se só tem messageContextInfo, não é mídia válida - if (Object.keys(msg).length === 1 && 'messageContextInfo' in msg) { + if (Object.keys(msg).length === 1 && Object.prototype.hasOwnProperty.call(msg, 'messageContextInfo')) { return false; }