mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 17:27:28 +00:00
refactor: share config adapter allowFrom and defaultTo helpers
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
buildAccountScopedDmSecurityPolicy,
|
||||
collectOpenGroupPolicyRestrictSendersWarnings,
|
||||
mapAllowFromEntries,
|
||||
} from "openclaw/plugin-sdk";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
@@ -147,10 +148,10 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = {
|
||||
tokenSource: account.tokenSource ?? undefined,
|
||||
}),
|
||||
resolveAllowFrom: ({ cfg, accountId }) =>
|
||||
(
|
||||
mapAllowFromEntries(
|
||||
getLineRuntime().channel.line.resolveLineAccount({ cfg, accountId: accountId ?? undefined })
|
||||
.config.allowFrom ?? []
|
||||
).map((entry) => String(entry)),
|
||||
.config.allowFrom,
|
||||
),
|
||||
formatAllowFrom: ({ allowFrom }) =>
|
||||
allowFrom
|
||||
.map((entry) => String(entry).trim())
|
||||
|
||||
Reference in New Issue
Block a user