Merge branch 'develop' into feat-mijs-expose-error-types
This commit is contained in:
parent
3156b2d2b5
commit
28af53e221
1031 changed files with 41072 additions and 16771 deletions
22
packages/frontend-shared/js/collapsed.ts
Normal file
22
packages/frontend-shared/js/collapsed.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* 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) ||
|
||||
(urls.length >= 4)
|
||||
)) || (note.files != null && note.files.length >= 5)
|
||||
);
|
||||
|
||||
return collapsed;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue