mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 14:28:27 +00:00
refactor: prune room legacy
This commit is contained in:
@@ -11,7 +11,7 @@ import type { SlackMessageEvent } from "../types.js";
|
||||
|
||||
import { normalizeAllowList, normalizeAllowListLower, normalizeSlackSlug } from "./allow-list.js";
|
||||
import { resolveSlackChannelConfig } from "./channel-config.js";
|
||||
import { isSlackRoomAllowedByPolicy } from "./policy.js";
|
||||
import { isSlackChannelAllowedByPolicy } from "./policy.js";
|
||||
|
||||
export function inferSlackChannelType(
|
||||
channelId?: string | null,
|
||||
@@ -314,7 +314,7 @@ export function createSlackMonitorContext(params: {
|
||||
const channelAllowlistConfigured =
|
||||
Boolean(params.channelsConfig) && Object.keys(params.channelsConfig ?? {}).length > 0;
|
||||
if (
|
||||
!isSlackRoomAllowedByPolicy({
|
||||
!isSlackChannelAllowedByPolicy({
|
||||
groupPolicy: params.groupPolicy,
|
||||
channelAllowlistConfigured,
|
||||
channelAllowed,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export function isSlackRoomAllowedByPolicy(params: {
|
||||
export function isSlackChannelAllowedByPolicy(params: {
|
||||
groupPolicy: "open" | "disabled" | "allowlist";
|
||||
channelAllowlistConfigured: boolean;
|
||||
channelAllowed: boolean;
|
||||
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
import { resolveSlackChannelConfig, type SlackChannelConfigResolved } from "./channel-config.js";
|
||||
import { buildSlackSlashCommandMatcher, resolveSlackSlashCommandConfig } from "./commands.js";
|
||||
import type { SlackMonitorContext } from "./context.js";
|
||||
import { isSlackRoomAllowedByPolicy } from "./policy.js";
|
||||
import { isSlackChannelAllowedByPolicy } from "./policy.js";
|
||||
import { deliverSlackSlashReplies } from "./replies.js";
|
||||
|
||||
type SlackBlock = { type: string; [key: string]: unknown };
|
||||
@@ -247,7 +247,7 @@ export function registerSlackMonitorSlashCommands(params: {
|
||||
Boolean(ctx.channelsConfig) && Object.keys(ctx.channelsConfig ?? {}).length > 0;
|
||||
const channelAllowed = channelConfig?.allowed !== false;
|
||||
if (
|
||||
!isSlackRoomAllowedByPolicy({
|
||||
!isSlackChannelAllowedByPolicy({
|
||||
groupPolicy: ctx.groupPolicy,
|
||||
channelAllowlistConfigured,
|
||||
channelAllowed,
|
||||
|
||||
Reference in New Issue
Block a user