Merge remote-tracking branch 'misskey-original/develop' into develop

# Conflicts:
#	package.json
#	packages/frontend/src/components/MkLaunchPad.vue
#	packages/frontend/src/ui/_common_/navbar-for-mobile.vue
#	packages/frontend/src/ui/_common_/navbar.vue
#	packages/frontend/src/ui/universal.vue
This commit is contained in:
mattyatea 2023-11-02 06:47:13 +09:00
commit d720501c82
38 changed files with 1022 additions and 769 deletions

View file

@ -3,12 +3,9 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import * as mfm from 'mfm-js';
import * as Misskey from 'misskey-js';
import { extractUrlFromMfm } from './extract-url-from-mfm.js';
export function shouldCollapsed(note: Misskey.entities.Note): boolean {
const urls = note.text ? extractUrlFromMfm(mfm.parse(note.text)) : null;
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')) ||
@ -17,7 +14,7 @@ export function shouldCollapsed(note: Misskey.entities.Note): boolean {
(note.text.split('\n').length > 9) ||
(note.text.length > 500) ||
(note.files.length >= 5) ||
(!!urls && urls.length >= 4)
(urls.length >= 4)
);
return collapsed;