refactor(channels): centralize match metadata

This commit is contained in:
Peter Steinberger
2026-01-21 18:21:19 +00:00
parent b52ab96e2c
commit 88d76d4be5
11 changed files with 73 additions and 38 deletions

View File

@@ -22,6 +22,7 @@ import { resolveThreadSessionKeys } from "../../../routing/session-key.js";
import { resolveMentionGatingWithBypass } from "../../../channels/mention-gating.js";
import { resolveConversationLabel } from "../../../channels/conversation-label.js";
import { resolveControlCommandGate } from "../../../channels/command-gating.js";
import { formatAllowlistMatchMeta } from "../../../channels/allowlist-match.js";
import {
readSessionUpdatedAt,
recordSessionMetaFromInbound,
@@ -131,9 +132,7 @@ export async function prepareSlackMessage(params: {
allowList: allowFromLower,
id: directUserId,
});
const allowMatchMeta = `matchKey=${allowMatch.matchKey ?? "none"} matchSource=${
allowMatch.matchSource ?? "none"
}`;
const allowMatchMeta = formatAllowlistMatchMeta(allowMatch);
if (!allowMatch.allowed) {
if (ctx.dmPolicy === "pairing") {
const sender = await ctx.resolveUserName(directUserId);