fix handling of private renotes

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
This commit is contained in:
ゆめ 2024-11-21 10:11:42 -06:00 committed by fly_mc
parent 437dbbe75d
commit 77705d34d1
2 changed files with 6 additions and 2 deletions

View file

@ -7,6 +7,7 @@ import { setImmediate } from 'node:timers/promises';
import * as mfm from 'mfm-js'; import * as mfm from 'mfm-js';
import { In, DataSource, IsNull, LessThan } from 'typeorm'; import { In, DataSource, IsNull, LessThan } from 'typeorm';
import * as Redis from 'ioredis'; import * as Redis from 'ioredis';
import * as Bull from 'bullmq';
import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common';
import { extractMentions } from '@/misc/extract-mentions.js'; import { extractMentions } from '@/misc/extract-mentions.js';
import { extractCustomEmojisFromMfm } from '@/misc/extract-custom-emojis-from-mfm.js'; import { extractCustomEmojisFromMfm } from '@/misc/extract-custom-emojis-from-mfm.js';
@ -295,7 +296,7 @@ export class NoteCreateService implements OnApplicationShutdown {
case 'followers': case 'followers':
// 他人のfollowers noteはreject // 他人のfollowers noteはreject
if (data.renote.userId !== user.id) { 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にする // Renote対象がfollowersならfollowersにする
@ -303,7 +304,7 @@ export class NoteCreateService implements OnApplicationShutdown {
break; break;
case 'specified': case 'specified':
// specified / direct noteはreject // 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');
} }
} }

View file

@ -37,6 +37,9 @@ export interface IObject {
tag?: IObject | IObject[]; tag?: IObject | IObject[];
sensitive?: boolean; sensitive?: boolean;
updated?: string; updated?: string;
visibility?: string;
mentionedUsers?: any[];
visibleUsers?: any[];
} }
/** /**