mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 15:18:28 +00:00
refactor(src): split oversized modules
This commit is contained in:
9
src/web/auto-reply/monitor/peer.ts
Normal file
9
src/web/auto-reply/monitor/peer.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { jidToE164, normalizeE164 } from "../../../utils.js";
|
||||
import type { WebInboundMsg } from "../types.js";
|
||||
|
||||
export function resolvePeerId(msg: WebInboundMsg) {
|
||||
if (msg.chatType === "group") return msg.conversationId ?? msg.from;
|
||||
if (msg.senderE164) return normalizeE164(msg.senderE164) ?? msg.senderE164;
|
||||
if (msg.from.includes("@")) return jidToE164(msg.from) ?? msg.from;
|
||||
return normalizeE164(msg.from) ?? msg.from;
|
||||
}
|
||||
Reference in New Issue
Block a user