summaryrefslogtreecommitdiff
path: root/packages/backend/src
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2024-10-14 17:51:47 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2024-10-14 17:51:47 +0900
commit77ebabb3dc76d6a422ea576ed60e5e4afe72d637 (patch)
treec796d622f0acd22f216c592a710ef5c0c0c52aec /packages/backend/src
parentrefactor (diff)
downloadsharkey-77ebabb3dc76d6a422ea576ed60e5e4afe72d637.tar.gz
sharkey-77ebabb3dc76d6a422ea576ed60e5e4afe72d637.tar.bz2
sharkey-77ebabb3dc76d6a422ea576ed60e5e4afe72d637.zip
Revert "refactor"
This reverts commit 7fd8ef344b33b0a157bc197cbd64069695806936.
Diffstat (limited to 'packages/backend/src')
-rw-r--r--packages/backend/src/core/entities/NoteEntityService.ts12
-rw-r--r--packages/backend/src/misc/is-renote.ts11
2 files changed, 11 insertions, 12 deletions
diff --git a/packages/backend/src/core/entities/NoteEntityService.ts b/packages/backend/src/core/entities/NoteEntityService.ts
index c24c80a5b5..e530772dd9 100644
--- a/packages/backend/src/core/entities/NoteEntityService.ts
+++ b/packages/backend/src/core/entities/NoteEntityService.ts
@@ -16,13 +16,23 @@ import { bindThis } from '@/decorators.js';
import { DebounceLoader } from '@/misc/loader.js';
import { IdService } from '@/core/IdService.js';
import { ReactionsBufferingService } from '@/core/ReactionsBufferingService.js';
-import { isPureRenote } from '@/misc/is-renote.js';
import type { OnModuleInit } from '@nestjs/common';
import type { CustomEmojiService } from '../CustomEmojiService.js';
import type { ReactionService } from '../ReactionService.js';
import type { UserEntityService } from './UserEntityService.js';
import type { DriveFileEntityService } from './DriveFileEntityService.js';
+function isPureRenote(note: MiNote): note is MiNote & { renoteId: MiNote['id']; renote: MiNote } {
+ return (
+ note.renote != null &&
+ note.reply == null &&
+ note.text == null &&
+ note.cw == null &&
+ (note.fileIds == null || note.fileIds.length === 0) &&
+ !note.hasPoll
+ );
+}
+
function getAppearNoteIds(notes: MiNote[]): Set<string> {
const appearNoteIds = new Set<string>();
for (const note of notes) {
diff --git a/packages/backend/src/misc/is-renote.ts b/packages/backend/src/misc/is-renote.ts
index 245057c64e..48f821806c 100644
--- a/packages/backend/src/misc/is-renote.ts
+++ b/packages/backend/src/misc/is-renote.ts
@@ -36,17 +36,6 @@ export function isQuote(note: Renote): note is Quote {
note.fileIds.length > 0;
}
-export function isPureRenote(note: MiNote): note is MiNote & { renoteId: MiNote['id']; renote: MiNote } {
- return (
- note.renote != null &&
- note.reply == null &&
- note.text == null &&
- note.cw == null &&
- (note.fileIds == null || note.fileIds.length === 0) &&
- !note.hasPoll
- );
-}
-
type PackedRenote =
Packed<'Note'> & {
renoteId: NonNullable<Packed<'Note'>['renoteId']>