fix(whatsapp): groupAllowFrom sender filter bypassed when groupPolicy is allowlist (#24670)

(cherry picked from commit af06ebd9a6)
This commit is contained in:
damaozi
2026-02-24 03:20:37 +08:00
committed by Peter Steinberger
parent 3f5e7f8156
commit c6bb7b0c04
4 changed files with 57 additions and 1 deletions

View File

@@ -16,10 +16,17 @@ export function resolveGroupPolicyFor(cfg: ReturnType<typeof loadConfig>, conver
ChatType: "group",
Provider: "whatsapp",
})?.id;
const whatsappCfg = cfg.channels?.whatsapp as
| { groupAllowFrom?: string[]; allowFrom?: string[] }
| undefined;
const hasGroupAllowFrom = Boolean(
whatsappCfg?.groupAllowFrom?.length || whatsappCfg?.allowFrom?.length,
);
return resolveChannelGroupPolicy({
cfg,
channel: "whatsapp",
groupId: groupId ?? conversationId,
hasGroupAllowFrom,
});
}