fix(backend): 宛先が指定されていない公開範囲がダイレクトのリノートは配送しないようにする

partially addresses #16021
This commit is contained in:
Kisaragi Marine 2025-05-10 21:27:20 +09:00
parent 039aacb31f
commit f3ee27eba1
No known key found for this signature in database
GPG Key ID: C6631564CD2110E4
1 changed files with 6 additions and 0 deletions

View File

@ -56,6 +56,7 @@ import { trackPromise } from '@/misc/promise-tracker.js';
import { IdentifiableError } from '@/misc/identifiable-error.js'; import { IdentifiableError } from '@/misc/identifiable-error.js';
import { CollapsedQueue } from '@/misc/collapsed-queue.js'; import { CollapsedQueue } from '@/misc/collapsed-queue.js';
import { CacheService } from '@/core/CacheService.js'; import { CacheService } from '@/core/CacheService.js';
import { isRenote } from '@/misc/is-renote.js';
type NotificationType = 'reply' | 'renote' | 'quote' | 'mention'; type NotificationType = 'reply' | 'renote' | 'quote' | 'mention';
@ -643,6 +644,11 @@ export class NoteCreateService implements OnApplicationShutdown {
//#region AP deliver //#region AP deliver
if (!data.localOnly && this.userEntityService.isLocalUser(user)) { if (!data.localOnly && this.userEntityService.isLocalUser(user)) {
(async () => { (async () => {
if (note.visibility === 'specified' && isRenote(note) && note.visibleUserIds.length === 0) {
// 自分しか見えるべきではないので配送する必要はない
return;
}
const noteActivity = await this.renderNoteOrRenoteActivity(data, note); const noteActivity = await this.renderNoteOrRenoteActivity(data, note);
const dm = this.apDeliverManagerService.createDeliverManager(user, noteActivity); const dm = this.apDeliverManagerService.createDeliverManager(user, noteActivity);