From 77705d34d19116657f48cc952969507783326e2e Mon Sep 17 00:00:00 2001 From: eternal-flame-AD Date: Thu, 21 Nov 2024 10:11:42 -0600 Subject: [PATCH] fix handling of private renotes Signed-off-by: eternal-flame-AD --- packages/backend/src/core/NoteCreateService.ts | 5 +++-- packages/backend/src/core/activitypub/type.ts | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 775f53f71..2a765bb25 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -7,6 +7,7 @@ import { setImmediate } from 'node:timers/promises'; import * as mfm from 'mfm-js'; import { In, DataSource, IsNull, LessThan } from 'typeorm'; import * as Redis from 'ioredis'; +import * as Bull from 'bullmq'; import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; import { extractMentions } from '@/misc/extract-mentions.js'; import { extractCustomEmojisFromMfm } from '@/misc/extract-custom-emojis-from-mfm.js'; @@ -295,7 +296,7 @@ export class NoteCreateService implements OnApplicationShutdown { case 'followers': // 他人のfollowers noteはreject if (data.renote.userId !== user.id) { - throw new Error('Renote target is not public or home'); + throw new Bull.UnrecoverableError('Renote target is not public or home'); } // Renote対象がfollowersならfollowersにする @@ -303,7 +304,7 @@ export class NoteCreateService implements OnApplicationShutdown { break; case 'specified': // specified / direct noteはreject - throw new Error('Renote target is not public or home'); + throw new Bull.UnrecoverableError('Renote target is not public or home'); } } diff --git a/packages/backend/src/core/activitypub/type.ts b/packages/backend/src/core/activitypub/type.ts index 2b94cbf1f..1e72db505 100644 --- a/packages/backend/src/core/activitypub/type.ts +++ b/packages/backend/src/core/activitypub/type.ts @@ -37,6 +37,9 @@ export interface IObject { tag?: IObject | IObject[]; sensitive?: boolean; updated?: string; + visibility?: string; + mentionedUsers?: any[]; + visibleUsers?: any[]; } /**