mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-17 20:21:13 +00:00
22 lines
693 B
TypeScript
22 lines
693 B
TypeScript
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
|
import { resolveIMessageAccount } from "./accounts.js";
|
|
|
|
export function resolveIMessageConfigAllowFrom(params: {
|
|
cfg: OpenClawConfig;
|
|
accountId?: string | null;
|
|
}): string[] {
|
|
return (resolveIMessageAccount(params).config.allowFrom ?? []).map((entry) => String(entry));
|
|
}
|
|
|
|
export function resolveIMessageConfigDefaultTo(params: {
|
|
cfg: OpenClawConfig;
|
|
accountId?: string | null;
|
|
}): string | undefined {
|
|
const defaultTo = resolveIMessageAccount(params).config.defaultTo;
|
|
if (defaultTo == null) {
|
|
return undefined;
|
|
}
|
|
const normalized = String(defaultTo).trim();
|
|
return normalized || undefined;
|
|
}
|