fix rebase errors
This commit is contained in:
parent
43b83ad3bc
commit
4c8ab73ecd
5 changed files with 29 additions and 28 deletions
|
|
@ -57,6 +57,7 @@ import { IdentifiableError } from '@/misc/identifiable-error.js';
|
|||
import { LatestNoteService } from '@/core/LatestNoteService.js';
|
||||
import { CollapsedQueue } from '@/misc/collapsed-queue.js';
|
||||
import { CacheService } from '@/core/CacheService.js';
|
||||
import { NoteVisibilityService } from '@/core/NoteVisibilityService.js';
|
||||
import { isPureRenote } from '@/misc/is-renote.js';
|
||||
|
||||
type NotificationType = 'reply' | 'renote' | 'quote' | 'mention';
|
||||
|
|
@ -224,6 +225,7 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||
private userBlockingService: UserBlockingService,
|
||||
private cacheService: CacheService,
|
||||
private latestNoteService: LatestNoteService,
|
||||
private readonly noteVisibilityService: NoteVisibilityService,
|
||||
) {
|
||||
this.updateNotesCountQueue = new CollapsedQueue(process.env.NODE_ENV !== 'test' ? 60 * 1000 * 5 : 0, this.collapseNotesCount, this.performUpdateNotesCount);
|
||||
}
|
||||
|
|
@ -320,7 +322,8 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||
}
|
||||
|
||||
// Check visibility
|
||||
if (!await this.noteEntityService.isVisibleForMe(data.renote, user.id)) {
|
||||
const visibilityCheck = await this.noteVisibilityService.checkNoteVisibilityAsync(data.renote, user.id);
|
||||
if (!visibilityCheck.accessible) {
|
||||
throw new IdentifiableError('be9529e9-fe72-4de0-ae43-0b363c4938af', 'Cannot renote an invisible note');
|
||||
}
|
||||
|
||||
|
|
@ -343,7 +346,8 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||
}
|
||||
|
||||
// Check visibility
|
||||
if (!await this.noteEntityService.isVisibleForMe(data.reply, user.id)) {
|
||||
const visibilityCheck = await this.noteVisibilityService.checkNoteVisibilityAsync(data.reply, user.id);
|
||||
if (!visibilityCheck.accessible) {
|
||||
throw new IdentifiableError('b98980fa-3780-406c-a935-b6d0eeee10d1', 'Cannot reply to an invisible note');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ import { IdentifiableError } from '@/misc/identifiable-error.js';
|
|||
import { LatestNoteService } from '@/core/LatestNoteService.js';
|
||||
import { CollapsedQueue } from '@/misc/collapsed-queue.js';
|
||||
import { NoteCreateService } from '@/core/NoteCreateService.js';
|
||||
import { NoteVisibilityService } from '@/core/NoteVisibilityService.js';
|
||||
import { isPureRenote } from '@/misc/is-renote.js';
|
||||
|
||||
type NotificationType = 'reply' | 'renote' | 'quote' | 'mention' | 'edited';
|
||||
|
|
@ -221,6 +222,7 @@ export class NoteEditService implements OnApplicationShutdown {
|
|||
private cacheService: CacheService,
|
||||
private latestNoteService: LatestNoteService,
|
||||
private noteCreateService: NoteCreateService,
|
||||
private readonly noteVisibilityService: NoteVisibilityService,
|
||||
) {
|
||||
this.updateNotesCountQueue = new CollapsedQueue(process.env.NODE_ENV !== 'test' ? 60 * 1000 * 5 : 0, this.collapseNotesCount, this.performUpdateNotesCount);
|
||||
}
|
||||
|
|
@ -339,7 +341,8 @@ export class NoteEditService implements OnApplicationShutdown {
|
|||
}
|
||||
|
||||
// Check visibility
|
||||
if (!await this.noteEntityService.isVisibleForMe(data.renote, user.id)) {
|
||||
const visibilityCheck = await this.noteVisibilityService.checkNoteVisibilityAsync(data.renote, user.id);
|
||||
if (!visibilityCheck.accessible) {
|
||||
throw new IdentifiableError('be9529e9-fe72-4de0-ae43-0b363c4938af', 'Cannot renote an invisible note');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import { ReactionsBufferingService } from '@/core/ReactionsBufferingService.js';
|
|||
import { QueryService } from '@/core/QueryService.js';
|
||||
import type { Config } from '@/config.js';
|
||||
import { NoteVisibilityService } from '@/core/NoteVisibilityService.js';
|
||||
import type { PopulatedNote } from '@/core/NoteVisibilityService.js';
|
||||
import type { NoteVisibilityData } from '@/core/NoteVisibilityService.js';
|
||||
import type { OnModuleInit } from '@nestjs/common';
|
||||
import type { CacheService } from '../CacheService.js';
|
||||
|
|
@ -653,29 +652,28 @@ export class NoteEntityService implements OnModuleInit {
|
|||
processErrors: note.processErrors,
|
||||
} : {}),
|
||||
|
||||
reply: opts.recurseReply && note.replyId ? this.pack(note.reply ?? opts._hint_?.notes.get(note.replyId) ?? note.replyId, me, {
|
||||
detail: false,
|
||||
skipHide: opts.skipHide,
|
||||
withReactionAndUserPairCache: opts.withReactionAndUserPairCache,
|
||||
_hint_: options?._hint_,
|
||||
reply: opts.recurseReply && note.replyId ? this.pack(note.reply ?? opts._hint_?.notes.get(note.replyId) ?? note.replyId, me, {
|
||||
detail: false,
|
||||
skipHide: opts.skipHide,
|
||||
withReactionAndUserPairCache: opts.withReactionAndUserPairCache,
|
||||
_hint_: options?._hint_,
|
||||
|
||||
// Don't silence target of self-reply, since the outer note will already be silenced.
|
||||
bypassSilence: bypassSilence || note.userId === note.replyUserId,
|
||||
}) : undefined,
|
||||
// Don't silence target of self-reply, since the outer note will already be silenced.
|
||||
bypassSilence: bypassSilence || note.userId === note.replyUserId,
|
||||
}) : undefined,
|
||||
|
||||
// The renote target needs to be packed with the reply, but we *must not* recurse any further.
|
||||
// Pass detail=false and recurseReply=true to make sure we only include the right data.
|
||||
renote: opts.recurseRenote && note.renoteId ? this.pack(note.renote ?? opts._hint_?.notes.get(note.renoteId) ?? note.renoteId, me, {
|
||||
detail: false,
|
||||
recurseReply: true,
|
||||
skipHide: opts.skipHide,
|
||||
withReactionAndUserPairCache: opts.withReactionAndUserPairCache,
|
||||
_hint_: options?._hint_,
|
||||
// The renote target needs to be packed with the reply, but we *must not* recurse any further.
|
||||
// Pass detail=false and recurseReply=true to make sure we only include the right data.
|
||||
renote: opts.recurseRenote && note.renoteId ? this.pack(note.renote ?? opts._hint_?.notes.get(note.renoteId) ?? note.renoteId, me, {
|
||||
detail: false,
|
||||
recurseReply: true,
|
||||
skipHide: opts.skipHide,
|
||||
withReactionAndUserPairCache: opts.withReactionAndUserPairCache,
|
||||
_hint_: options?._hint_,
|
||||
|
||||
// Don't silence target of self-renote, since the outer note will already be silenced.
|
||||
bypassSilence: bypassSilence || note.userId === note.renoteUserId,
|
||||
}) : undefined,
|
||||
} : {}),
|
||||
// Don't silence target of self-renote, since the outer note will already be silenced.
|
||||
bypassSilence: bypassSilence || note.userId === note.renoteUserId,
|
||||
}) : undefined,
|
||||
});
|
||||
|
||||
this.noteVisibilityService.syncVisibility(packed);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ import { NoteCreateService } from '@/core/NoteCreateService.js';
|
|||
import { DI } from '@/di-symbols.js';
|
||||
import { isQuote, isRenote } from '@/misc/is-renote.js';
|
||||
import { IdentifiableError } from '@/misc/identifiable-error.js';
|
||||
import { NoteVisibilityService } from '@/core/NoteVisibilityService.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
|
||||
export const meta = {
|
||||
|
|
@ -262,7 +261,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
|
||||
private noteEntityService: NoteEntityService,
|
||||
private noteCreateService: NoteCreateService,
|
||||
private readonly noteVisibilityService: NoteVisibilityService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
if (ps.text && ps.text.length > this.config.maxNoteLength) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import { NoteEditService } from '@/core/NoteEditService.js';
|
|||
import { DI } from '@/di-symbols.js';
|
||||
import { isQuote, isRenote } from '@/misc/is-renote.js';
|
||||
import { IdentifiableError } from '@/misc/identifiable-error.js';
|
||||
import { NoteVisibilityService } from '@/core/NoteVisibilityService.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
|
||||
export const meta = {
|
||||
|
|
@ -312,7 +311,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
|
||||
private noteEntityService: NoteEntityService,
|
||||
private noteEditService: NoteEditService,
|
||||
private readonly noteVisibilityService: NoteVisibilityService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
if (ps.text && ps.text.length > this.config.maxNoteLength) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue