mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-16 01:55:44 +01:00
c1514ce91d
Fix #13290
21 lines
579 B
TypeScript
21 lines
579 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import * as Misskey from 'misskey-js';
|
|
|
|
export function shouldCollapsed(note: Misskey.entities.Note, urls: string[]): 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) ||
|
|
(urls.length >= 4)
|
|
);
|
|
|
|
return collapsed;
|
|
}
|