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 {
ChannelMessageActionName,
ChannelPlugin,
@@ -141,17 +141,13 @@ export const msteamsPlugin: ChannelPlugin<ResolvedMSTeamsAccount> = {
groupPolicy: cfg.channels?.msteams?.groupPolicy,
defaultGroupPolicy,
});
if (groupPolicy !== "open") {
return [];
}
return [
buildOpenGroupPolicyRestrictSendersWarning({
surface: "MS Teams groups",
openScope: "any member",
groupPolicyPath: "channels.msteams.groupPolicy",
groupAllowFromPath: "channels.msteams.groupAllowFrom",
}),
];
return collectOpenGroupPolicyRestrictSendersWarnings({
groupPolicy,
surface: "MS Teams groups",
openScope: "any member",
groupPolicyPath: "channels.msteams.groupPolicy",
groupAllowFromPath: "channels.msteams.groupAllowFrom",
});
},
},
setup: {