mirror of https://github.com/openclaw/openclaw.git
27 lines
727 B
TypeScript
27 lines
727 B
TypeScript
import {
|
|
matchIMessageAcpConversation,
|
|
normalizeIMessageAcpConversationId,
|
|
resolveIMessageConversationIdFromTarget,
|
|
} from "openclaw/plugin-sdk/imessage-core";
|
|
import { normalizeIMessageHandle } from "./targets.js";
|
|
|
|
export {
|
|
matchIMessageAcpConversation,
|
|
normalizeIMessageAcpConversationId,
|
|
resolveIMessageConversationIdFromTarget,
|
|
};
|
|
|
|
export function resolveIMessageInboundConversationId(params: {
|
|
isGroup: boolean;
|
|
sender: string;
|
|
chatId?: number;
|
|
}): string | undefined {
|
|
if (params.isGroup) {
|
|
return params.chatId != null && Number.isFinite(params.chatId)
|
|
? String(params.chatId)
|
|
: undefined;
|
|
}
|
|
const sender = normalizeIMessageHandle(params.sender);
|
|
return sender || undefined;
|
|
}
|