From eed9c632473845387ba87cc02e83630f4aeef2d6 Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Wed, 29 Mar 2023 21:38:52 +0200 Subject: [PATCH] get post details from object --- packages/backend/src/queue/processors/db/import-posts.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/queue/processors/db/import-posts.ts b/packages/backend/src/queue/processors/db/import-posts.ts index f4948269c5..6215af7079 100644 --- a/packages/backend/src/queue/processors/db/import-posts.ts +++ b/packages/backend/src/queue/processors/db/import-posts.ts @@ -84,7 +84,7 @@ export async function importPosts( for (const post of parsed.orderedItems) { try { linenum++; - if (post.inReplyTo != null) { + if (post.object.inReplyTo != null) { logger.info(`Is reply, skip [${linenum}] ...`); continue; } @@ -94,7 +94,7 @@ export async function importPosts( } let text; try { - text = htmlToMfm(post.content, post.tag); + text = htmlToMfm(post.object.content, post.object.tag); } catch (e) { logger.warn(`Error while parsing text in line ${linenum}: ${e}`); continue; @@ -102,7 +102,7 @@ export async function importPosts( logger.info(`Posting[${linenum}] ...`); const note = await create(user, { - createdAt: new Date(post.published), + createdAt: new Date(post.object.published), files: undefined, poll: undefined, text: text || undefined,