refactor: centralize open group-policy warning flow collectors

This commit is contained in:
Peter Steinberger
2026-03-07 22:45:40 +00:00
parent b456649974
commit b7d03ea1f5
15 changed files with 272 additions and 190 deletions

View File

@@ -1,4 +1,4 @@
import { buildOpenGroupPolicyRestrictSendersWarning } from "openclaw/plugin-sdk";
import { collectOpenGroupPolicyRestrictSendersWarnings } from "openclaw/plugin-sdk";
import type { ChannelMeta, ChannelPlugin, ClawdbotConfig } from "openclaw/plugin-sdk/feishu";
import {
buildProbeChannelStatusSummary,
@@ -267,15 +267,13 @@ export const feishuPlugin: ChannelPlugin<ResolvedFeishuAccount> = {
groupPolicy: feishuCfg?.groupPolicy,
defaultGroupPolicy,
});
if (groupPolicy !== "open") return [];
return [
buildOpenGroupPolicyRestrictSendersWarning({
surface: `Feishu[${account.accountId}] groups`,
openScope: "any member",
groupPolicyPath: "channels.feishu.groupPolicy",
groupAllowFromPath: "channels.feishu.groupAllowFrom",
}),
];
return collectOpenGroupPolicyRestrictSendersWarnings({
groupPolicy,
surface: `Feishu[${account.accountId}] groups`,
openScope: "any member",
groupPolicyPath: "channels.feishu.groupPolicy",
groupAllowFromPath: "channels.feishu.groupAllowFrom",
});
},
},
setup: {