From 2e420c4e1bd9f10686439aa563d5c896091f8e76 Mon Sep 17 00:00:00 2001 From: Tes Sal Date: Wed, 28 Jan 2026 12:53:16 +0000 Subject: [PATCH] fix: respect groupPolicy when explicit group configs exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #3323 Previously, having ANY explicit group config in channels..groups would enable allowlist mode, blocking all groups not explicitly listed — even when groupPolicy was set to 'open'. Now allowlistEnabled only activates when groupPolicy === 'allowlist', allowing explicit group configs (e.g., requireMention settings) to coexist with groupPolicy: 'open' without creating an implicit allowlist. --- src/config/group-policy.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/config/group-policy.ts b/src/config/group-policy.ts index ae8967192..cea3aed8a 100644 --- a/src/config/group-policy.ts +++ b/src/config/group-policy.ts @@ -110,7 +110,13 @@ export function resolveChannelGroupPolicy(params: { }): ChannelGroupPolicy { const { cfg, channel } = params; const groups = resolveChannelGroups(cfg, channel, params.accountId); - const allowlistEnabled = Boolean(groups && Object.keys(groups).length > 0); + // Only enable allowlist when groupPolicy is explicitly "allowlist". + // This allows explicit group configs (e.g., requireMention) to coexist + // with groupPolicy: "open" without creating an implicit allowlist. + const channelConfig = cfg.channels?.[channel]; + const groupPolicy = channelConfig?.groupPolicy ?? "open"; + const allowlistEnabled = + groupPolicy === "allowlist" && Boolean(groups && Object.keys(groups).length > 0); const normalizedId = params.groupId?.trim(); const groupConfig = normalizedId && groups ? groups[normalizedId] : undefined; const defaultConfig = groups?.["*"];