mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 02:40:20 +00:00
refactor: move remaining channel seams into plugins
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { buildAccountScopedAllowlistConfigEditor } from "openclaw/plugin-sdk/compat";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
buildAccountScopedDmSecurityPolicy,
|
||||
@@ -195,11 +196,13 @@ export const whatsappPlugin: ChannelPlugin<ResolvedWhatsAppAccount> = {
|
||||
groupPolicy: account.groupPolicy,
|
||||
};
|
||||
},
|
||||
resolveConfigEdit: ({ scope, pathPrefix, writeTarget }) => ({
|
||||
pathPrefix,
|
||||
writeTarget,
|
||||
readPaths: [[scope === "dm" ? "allowFrom" : "groupAllowFrom"]],
|
||||
writePath: [scope === "dm" ? "allowFrom" : "groupAllowFrom"],
|
||||
applyConfigEdit: buildAccountScopedAllowlistConfigEditor({
|
||||
channelId: "whatsapp",
|
||||
normalize: ({ values }) => formatWhatsAppConfigAllowFromEntries(values),
|
||||
resolvePaths: (scope) => ({
|
||||
readPaths: [[scope === "dm" ? "allowFrom" : "groupAllowFrom"]],
|
||||
writePath: [scope === "dm" ? "allowFrom" : "groupAllowFrom"],
|
||||
}),
|
||||
}),
|
||||
},
|
||||
security: {
|
||||
|
||||
Reference in New Issue
Block a user