fix: normalize slack channel types for sessions

This commit is contained in:
Peter Steinberger
2026-01-15 08:00:07 +00:00
parent 0ac5480034
commit f3519d895c
3 changed files with 93 additions and 9 deletions

View File

@@ -19,7 +19,7 @@ import type { SlackMessageEvent } from "../../types.js";
import { allowListMatches, resolveSlackUserAllowed } from "../allow-list.js";
import { isSlackSenderAllowListed, resolveSlackEffectiveAllowFrom } from "../auth.js";
import { resolveSlackChannelConfig } from "../channel-config.js";
import type { SlackMonitorContext } from "../context.js";
import { normalizeSlackChannelType, type SlackMonitorContext } from "../context.js";
import { resolveSlackMedia, resolveSlackThreadStarter } from "../media.js";
import type { PreparedSlackMessage } from "./types.js";
@@ -45,7 +45,7 @@ export async function prepareSlackMessage(params: {
channelType = channelType ?? channelInfo.type;
}
const channelName = channelInfo?.name;
const resolvedChannelType = channelType;
const resolvedChannelType = normalizeSlackChannelType(channelType, message.channel);
const isDirectMessage = resolvedChannelType === "im";
const isGroupDm = resolvedChannelType === "mpim";
const isRoom = resolvedChannelType === "channel" || resolvedChannelType === "group";