Merge branch 'develop' into no-websocket
This commit is contained in:
commit
6b7806a3ae
|
@ -33,7 +33,7 @@
|
|||
(Cherry-picked from https://github.com/yojo-art/cherrypick/pull/568 and https://github.com/team-shahu/misskey/pull/38)
|
||||
- Enhance: ユーザーごとにノートの表示が高速化するように
|
||||
- Fix: システムアカウントの名前がサーバー名と同期されない問題を修正
|
||||
- Fix: 大文字を含むユーザの URL で紹介された場合に 404 エラーを返す問題 #15813
|
||||
- Fix: 大文字を含むユーザの URL で照会された場合に 404 エラーを返す問題 #15813
|
||||
- Fix: リードレプリカ設定時にレコードの追加・更新・削除を伴うクエリを発行した際はmasterノードで実行されるように調整( #10897 )
|
||||
- Fix: ファイルアップロード時の挙動を一部調整(#15895)
|
||||
|
||||
|
|
|
@ -6,17 +6,30 @@
|
|||
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)
|
||||
);
|
||||
if (note.cw != null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return collapsed;
|
||||
if (note.text != null) {
|
||||
if (
|
||||
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
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (urls.length >= 4) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (note.files != null && note.files.length >= 5) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ export function maybeMakeRelative(urlStr: string, baseStr: string): string {
|
|||
return urlObj.pathname + urlObj.search + urlObj.hash;
|
||||
}
|
||||
return urlStr;
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue