mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 18:58:26 +00:00
fix(slack): respect top-level requireMention config
The `channels.slack.requireMention` setting was defined in the schema but never passed to `resolveSlackChannelConfig()`, which always defaulted to `true`. This meant setting `requireMention: false` at the top level had no effect—channels still required mentions. Pass `slackCfg.requireMention` as `defaultRequireMention` to the resolver and use it as the fallback instead of hardcoded `true`. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Peter Steinberger
parent
6ffd7111a6
commit
09ce6ff99e
@@ -34,6 +34,7 @@ export type SlackMonitorContext = {
|
||||
allowFrom: string[];
|
||||
groupDmEnabled: boolean;
|
||||
groupDmChannels: string[];
|
||||
defaultRequireMention: boolean;
|
||||
channelsConfig?: Record<
|
||||
string,
|
||||
{
|
||||
@@ -103,6 +104,7 @@ export function createSlackMonitorContext(params: {
|
||||
allowFrom: Array<string | number> | undefined;
|
||||
groupDmEnabled: boolean;
|
||||
groupDmChannels: Array<string | number> | undefined;
|
||||
defaultRequireMention?: boolean;
|
||||
channelsConfig?: SlackMonitorContext["channelsConfig"];
|
||||
groupPolicy: SlackMonitorContext["groupPolicy"];
|
||||
useAccessGroups: boolean;
|
||||
@@ -132,6 +134,7 @@ export function createSlackMonitorContext(params: {
|
||||
|
||||
const allowFrom = normalizeAllowList(params.allowFrom);
|
||||
const groupDmChannels = normalizeAllowList(params.groupDmChannels);
|
||||
const defaultRequireMention = params.defaultRequireMention ?? true;
|
||||
|
||||
const markMessageSeen = (channelId: string | undefined, ts?: string) => {
|
||||
if (!channelId || !ts) return false;
|
||||
@@ -274,6 +277,7 @@ export function createSlackMonitorContext(params: {
|
||||
channelId: p.channelId,
|
||||
channelName: p.channelName,
|
||||
channels: params.channelsConfig,
|
||||
defaultRequireMention,
|
||||
});
|
||||
const channelAllowed = channelConfig?.allowed !== false;
|
||||
const channelAllowlistConfigured =
|
||||
@@ -330,6 +334,7 @@ export function createSlackMonitorContext(params: {
|
||||
allowFrom,
|
||||
groupDmEnabled: params.groupDmEnabled,
|
||||
groupDmChannels,
|
||||
defaultRequireMention,
|
||||
channelsConfig: params.channelsConfig,
|
||||
groupPolicy: params.groupPolicy,
|
||||
useAccessGroups: params.useAccessGroups,
|
||||
|
||||
Reference in New Issue
Block a user