mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 08:37:41 +00:00
Feature/default messenger delivery target (openclaw#16985) thanks @KirillShchetinin
Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: KirillShchetinin <13061871+KirillShchetinin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
59e58bf81c
commit
ee519086f6
@@ -169,20 +169,29 @@ export function resolveOutboundTarget(params: {
|
||||
})
|
||||
: undefined);
|
||||
|
||||
// Fall back to per-channel defaultTo when no explicit target is provided.
|
||||
const effectiveTo =
|
||||
params.to?.trim() ||
|
||||
(params.cfg && plugin.config.resolveDefaultTo
|
||||
? plugin.config.resolveDefaultTo({
|
||||
cfg: params.cfg,
|
||||
accountId: params.accountId ?? undefined,
|
||||
})
|
||||
: undefined);
|
||||
|
||||
const resolveTarget = plugin.outbound?.resolveTarget;
|
||||
if (resolveTarget) {
|
||||
return resolveTarget({
|
||||
cfg: params.cfg,
|
||||
to: params.to,
|
||||
to: effectiveTo,
|
||||
allowFrom,
|
||||
accountId: params.accountId ?? undefined,
|
||||
mode: params.mode ?? "explicit",
|
||||
});
|
||||
}
|
||||
|
||||
const trimmed = params.to?.trim();
|
||||
if (trimmed) {
|
||||
return { ok: true, to: trimmed };
|
||||
if (effectiveTo) {
|
||||
return { ok: true, to: effectiveTo };
|
||||
}
|
||||
const hint = plugin.messaging?.targetResolver?.hint;
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user