mirror of
https://iceshrimp.dev/Crimekillz/jointrashposs.git
synced 2024-11-24 09:49:06 +01:00
1f2b1aa58b
* wip * (add) mfm preview * (fix) iroiro * (Fix) build error * (fix) something
20 lines
551 B
TypeScript
20 lines
551 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import * as Misskey from 'misskey-js';
|
|
|
|
export function shouldCollapsed(note: Misskey.entities.Note): boolean {
|
|
const collapsed = note?.cw == null && note?.text != null && (
|
|
(note.text.includes('$[x2')) ||
|
|
(note.text.includes('$[x3')) ||
|
|
(note.text.includes('$[x4')) ||
|
|
(note.text.includes('$[scale')) ||
|
|
(note.text.split('\n').length > 9) ||
|
|
(note.text.length > 500) ||
|
|
(note.files.length >= 5)
|
|
);
|
|
|
|
return collapsed;
|
|
} |