diff --git a/packages/backend/src/queue/processors/ImportNotesProcessorService.ts b/packages/backend/src/queue/processors/ImportNotesProcessorService.ts index 552b69d92d..942870dfc7 100644 --- a/packages/backend/src/queue/processors/ImportNotesProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportNotesProcessorService.ts @@ -72,7 +72,6 @@ export class ImportNotesProcessorService { } } - // Function was taken from Firefish and modified for our needs @bindThis private async recreateChain(idFieldPath: string[], replyFieldPath: string[], arr: any[], includeOrphans: boolean): Promise { type NotesMap = { @@ -378,7 +377,11 @@ export class ImportNotesProcessorService { return; } - if (toot.directMessage) return; + const followers = toot.to.some((str: string) => str.includes('/followers')); + + if (toot.directMessage || (!toot.to.includes('https://www.w3.org/ns/activitystreams#Public') || !followers)) return; + + const visibility = followers ? 'home' : 'public'; const date = new Date(toot.object.published); let text = undefined; @@ -417,7 +420,7 @@ export class ImportNotesProcessorService { } } - const createdNote = await this.noteCreateService.import(user, { createdAt: date, text: text, files: files, apMentions: new Array(0), cw: toot.object.sensitive ? toot.object.summary : null, reply: reply }); + const createdNote = await this.noteCreateService.import(user, { createdAt: date, text: text, files: files, visibility: visibility, apMentions: new Array(0), cw: toot.object.sensitive ? toot.object.summary : null, reply: reply }); if (toot.childNotes) this.queueService.createImportMastoToDbJob(user, toot.childNotes, createdNote.id); }