chore: move isPureRenote to misc
This commit is contained in:
parent
c2505b12d6
commit
bfa6d7b525
|
|
@ -0,0 +1,10 @@
|
||||||
|
import type { MiNote } from '@/models/Note.js';
|
||||||
|
|
||||||
|
export function isPureRenote(note: MiNote): boolean {
|
||||||
|
if (!note.renoteId) return false;
|
||||||
|
|
||||||
|
if (note.text) return false; // it's quoted with text
|
||||||
|
if (note.fileIds.length !== 0) return false; // it's quoted with files
|
||||||
|
if (note.hasPoll) return false; // it's quoted with poll
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
@ -17,6 +17,7 @@ import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
|
||||||
import { NoteCreateService } from '@/core/NoteCreateService.js';
|
import { NoteCreateService } from '@/core/NoteCreateService.js';
|
||||||
import { DI } from '@/di-symbols.js';
|
import { DI } from '@/di-symbols.js';
|
||||||
import { ApiError } from '../../error.js';
|
import { ApiError } from '../../error.js';
|
||||||
|
import { isPureRenote } from '@/misc/is-pure-renote.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
tags: ['notes'],
|
tags: ['notes'],
|
||||||
|
|
@ -214,15 +215,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isPureRenote(note: MiNote): boolean {
|
|
||||||
if (!note.renoteId) return false;
|
|
||||||
|
|
||||||
if (note.text) return false; // it's quoted with text
|
|
||||||
if (note.fileIds.length !== 0) return false; // it's quoted with files
|
|
||||||
if (note.hasPoll) return false; // it's quoted with poll
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
let renote: MiNote | null = null;
|
let renote: MiNote | null = null;
|
||||||
if (ps.renoteId != null) {
|
if (ps.renoteId != null) {
|
||||||
// Fetch renote to note
|
// Fetch renote to note
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue