From 67420e9a810e09da3240eea3c11374575f8f0bee Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 5 Jan 2026 02:33:51 +0100 Subject: [PATCH] fix: allow group activation for allowFrom senders --- src/auto-reply/reply/commands.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/auto-reply/reply/commands.ts b/src/auto-reply/reply/commands.ts index 2af87954f..7c9971c46 100644 --- a/src/auto-reply/reply/commands.ts +++ b/src/auto-reply/reply/commands.ts @@ -64,7 +64,7 @@ export function buildCommandContext(params: { const from = (ctx.From ?? "").replace(/^whatsapp:/, ""); const to = (ctx.To ?? "").replace(/^whatsapp:/, ""); const allowFromList = - configuredAllowFrom?.filter((entry) => entry && entry.trim()) ?? []; + configuredAllowFrom?.filter((entry) => entry?.trim()) ?? []; const allowAll = !isWhatsAppSurface || allowFromList.length === 0 || @@ -163,18 +163,15 @@ export async function handleCommands(params: { reply: { text: "⚙️ Group activation only applies to group chats." }, }; } - const activationOwnerList = - command.ownerList.length > 0 - ? command.ownerList - : command.isWhatsAppSurface && command.to - ? [normalizeE164(command.to)] - : []; + const activationOwnerList = command.ownerList; const activationSenderE164 = command.senderE164 ? normalizeE164(command.senderE164) : ""; const isActivationOwner = - Boolean(activationSenderE164) && - activationOwnerList.includes(activationSenderE164); + !command.isWhatsAppSurface || activationOwnerList.length === 0 + ? command.isAuthorizedSender + : Boolean(activationSenderE164) && + activationOwnerList.includes(activationSenderE164); if ( !command.isAuthorizedSender ||