mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 04:49:34 +00:00
refactor(channels): centralize runtime group policy handling
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
formatPairingApproveHint,
|
||||
migrateBaseNameToDefaultAccount,
|
||||
normalizeAccountId,
|
||||
resolveRuntimeGroupPolicy,
|
||||
resolveAllowlistProviderRuntimeGroupPolicy,
|
||||
setAccountEnabledInConfigSection,
|
||||
type ChannelMessageActionAdapter,
|
||||
type ChannelMessageActionName,
|
||||
@@ -230,12 +230,10 @@ export const mattermostPlugin: ChannelPlugin<ResolvedMattermostAccount> = {
|
||||
},
|
||||
collectWarnings: ({ account, cfg }) => {
|
||||
const defaultGroupPolicy = cfg.channels?.defaults?.groupPolicy;
|
||||
const { groupPolicy } = resolveRuntimeGroupPolicy({
|
||||
const { groupPolicy } = resolveAllowlistProviderRuntimeGroupPolicy({
|
||||
providerConfigPresent: cfg.channels?.mattermost !== undefined,
|
||||
groupPolicy: account.config.groupPolicy,
|
||||
defaultGroupPolicy,
|
||||
configuredFallbackPolicy: "allowlist",
|
||||
missingProviderFallbackPolicy: "allowlist",
|
||||
});
|
||||
if (groupPolicy !== "open") {
|
||||
return [];
|
||||
|
||||
Reference in New Issue
Block a user