mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 03:45:46 -06:00
a2a68d154b
* fix(agent): honor recipient session routing Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com> Co-authored-by: pingfanfan <pingfan.work@gmail.com> * fix(agent): preserve canonical recipient routes * fix(agent): require exact recipient routes Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com> Co-authored-by: pingfanfan <pingfan.work@gmail.com> * fix(agent): harden recipient route resolution * fix(imessage): require canonical recipient handles * fix(agent): refine provider recipient exactness * fix(agent): bound direct alias session routing * fix(signal): preserve direct alias route type * fix(agent): honor binding-scoped recipient sessions * fix(routing): honor configured main session aliases * fix(clickclack): align account-owned session routes * fix(twitch): preserve canonical recipient sessions * fix(routing): isolate stable outbound identities * chore: defer recipient session changelog * fix(sms): use dedicated channel SDK facade --------- Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com> Co-authored-by: pingfanfan <pingfan.work@gmail.com>
19 lines
584 B
TypeScript
19 lines
584 B
TypeScript
export function normalizeLineMessagingTarget(target: string): string | undefined {
|
|
const trimmed = target.trim();
|
|
if (!trimmed) {
|
|
return undefined;
|
|
}
|
|
return trimmed.replace(/^line:(group|room|user):/i, "").replace(/^line:/i, "");
|
|
}
|
|
|
|
export function inferLineTargetChatType(target: string): "direct" | "group" | undefined {
|
|
const normalized = normalizeLineMessagingTarget(target);
|
|
if (!normalized) {
|
|
return undefined;
|
|
}
|
|
if (/^U[a-f0-9]{32}$/i.test(normalized)) {
|
|
return "direct";
|
|
}
|
|
return /^[CR][a-f0-9]{32}$/i.test(normalized) ? "group" : undefined;
|
|
}
|