mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 18:34:57 +00:00
refactor(line): share source info parsing
This commit is contained in:
@@ -45,6 +45,17 @@ const { buildLineMessageContextMock, buildLinePostbackContextMock } = vi.hoisted
|
||||
vi.mock("./bot-message-context.js", () => ({
|
||||
buildLineMessageContext: (...args: unknown[]) => buildLineMessageContextMock(...args),
|
||||
buildLinePostbackContext: (...args: unknown[]) => buildLinePostbackContextMock(...args),
|
||||
getLineSourceInfo: (source: {
|
||||
type?: string;
|
||||
userId?: string;
|
||||
groupId?: string;
|
||||
roomId?: string;
|
||||
}) => ({
|
||||
userId: source.userId,
|
||||
groupId: source.type === "group" ? source.groupId : undefined,
|
||||
roomId: source.type === "room" ? source.roomId : undefined,
|
||||
isGroup: source.type === "group" || source.type === "room",
|
||||
}),
|
||||
}));
|
||||
|
||||
const { readAllowFromStoreMock, upsertPairingRequestMock } = vi.hoisted(() => ({
|
||||
|
||||
Reference in New Issue
Block a user