From ede47e45c8162674a02d28862f256dd072d9570f Mon Sep 17 00:00:00 2001 From: April John Date: Mon, 8 May 2023 22:06:30 +0200 Subject: [PATCH] try fetching replies --- packages/backend/src/queue/processors/db/import-posts.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/queue/processors/db/import-posts.ts b/packages/backend/src/queue/processors/db/import-posts.ts index a0a916b41e..cd24029fbd 100644 --- a/packages/backend/src/queue/processors/db/import-posts.ts +++ b/packages/backend/src/queue/processors/db/import-posts.ts @@ -9,6 +9,7 @@ import type { DbUserImportPostsJobData } from "@/queue/types.js"; import { queueLogger } from "../../logger.js"; import type Bull from "bull"; import { htmlToMfm } from "@/remote/activitypub/misc/html-to-mfm.js"; +import { resolveNote } from "@/remote/activitypub/models/note.js"; const logger = queueLogger.createSubLogger("import-posts"); @@ -81,8 +82,9 @@ export async function importPosts( for (const post of parsed.orderedItems) { try { linenum++; + let reply = null; if (post.object.inReplyTo != null) { - continue; + reply = await resolveNote(post.object.inReplyTo); } if (post.directMessage) { continue; @@ -105,7 +107,7 @@ export async function importPosts( files: undefined, poll: undefined, text: text || undefined, - reply: null, + reply, renote: null, cw: post.sensitive, localOnly: false,