refactor(channels): reuse runtime group policy helpers

This commit is contained in:
Peter Steinberger
2026-02-22 12:44:02 +01:00
parent 13944f773f
commit 6dd36a6b77
31 changed files with 119 additions and 40 deletions

View File

@@ -5,6 +5,7 @@ import {
logInboundDrop,
recordPendingHistoryEntryIfEnabled,
resolveControlCommandGate,
resolveDefaultGroupPolicy,
resolveMentionGating,
formatAllowlistMatchMeta,
type HistoryEntry,
@@ -174,7 +175,7 @@ export function createMSTeamsMessageHandler(deps: MSTeamsMessageHandlerDeps) {
}
}
const defaultGroupPolicy = cfg.channels?.defaults?.groupPolicy;
const defaultGroupPolicy = resolveDefaultGroupPolicy(cfg);
const groupPolicy =
!isDirectMessage && msteamsCfg
? (msteamsCfg.groupPolicy ?? defaultGroupPolicy ?? "allowlist")