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,6 +1,6 @@
import {
buildAccountScopedDmSecurityPolicy,
buildOpenGroupPolicyRestrictSendersWarning,
collectOpenGroupPolicyRestrictSendersWarnings,
} from "openclaw/plugin-sdk";
import {
buildChannelConfigSchema,
@@ -181,18 +181,14 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = {
groupPolicy: account.config.groupPolicy,
defaultGroupPolicy,
});
if (groupPolicy !== "open") {
return [];
}
return [
buildOpenGroupPolicyRestrictSendersWarning({
surface: "LINE groups",
openScope: "any member in groups",
groupPolicyPath: "channels.line.groupPolicy",
groupAllowFromPath: "channels.line.groupAllowFrom",
mentionGated: false,
}),
];
return collectOpenGroupPolicyRestrictSendersWarnings({
groupPolicy,
surface: "LINE groups",
openScope: "any member in groups",
groupPolicyPath: "channels.line.groupPolicy",
groupAllowFromPath: "channels.line.groupAllowFrom",
mentionGated: false,
});
},
},
groups: {