From 44cafbb9f238e13e079135b96c4a791fb3b7faf0 Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Wed, 29 May 2024 07:11:29 +0900 Subject: [PATCH 1/9] refactor: avoid `as any[]` on FetchInstanceMetadataService.ts (#13905) * refactor: avoid `as any[]` on FetchInstanceMetadataService.ts * apply suggestion Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> --- packages/backend/src/core/FetchInstanceMetadataService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/core/FetchInstanceMetadataService.ts b/packages/backend/src/core/FetchInstanceMetadataService.ts index 8d173855f3..aa16468ecb 100644 --- a/packages/backend/src/core/FetchInstanceMetadataService.ts +++ b/packages/backend/src/core/FetchInstanceMetadataService.ts @@ -154,7 +154,7 @@ export class FetchInstanceMetadataService { throw new Error('No wellknown links'); } - const links = wellknown.links as any[]; + const links = wellknown.links as ({ rel: string, href: string; })[]; const link1_0 = links.find(link => link.rel === 'http://nodeinfo.diaspora.software/ns/schema/1.0'); const link2_0 = links.find(link => link.rel === 'http://nodeinfo.diaspora.software/ns/schema/2.0'); From e57ce4fa0f663210514ecda728562a73c0fe9c5e Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Wed, 29 May 2024 07:12:20 +0900 Subject: [PATCH 2/9] chore(backend): rename local variable (#13904) much -> matched --- packages/backend/src/core/DriveService.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/backend/src/core/DriveService.ts b/packages/backend/src/core/DriveService.ts index 63fa26f69d..26cf532c70 100644 --- a/packages/backend/src/core/DriveService.ts +++ b/packages/backend/src/core/DriveService.ts @@ -497,20 +497,20 @@ export class DriveService { if (user && !force) { // Check if there is a file with the same hash - const much = await this.driveFilesRepository.findOneBy({ + const matched = await this.driveFilesRepository.findOneBy({ md5: info.md5, userId: user.id, }); - if (much) { - this.registerLogger.info(`file with same hash is found: ${much.id}`); - if (sensitive && !much.isSensitive) { + if (matched) { + this.registerLogger.info(`file with same hash is found: ${matched.id}`); + if (sensitive && !matched.isSensitive) { // The file is federated as sensitive for this time, but was federated as non-sensitive before. // Therefore, update the file to sensitive. - await this.driveFilesRepository.update({ id: much.id }, { isSensitive: true }); - much.isSensitive = true; + await this.driveFilesRepository.update({ id: matched.id }, { isSensitive: true }); + matched.isSensitive = true; } - return much; + return matched; } } From cf670e8a3dc9830110312b54eceaea29cf20495c Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Wed, 29 May 2024 07:12:50 +0900 Subject: [PATCH 3/9] refactor(backend): avoid `as any` on CustomEmojiService.ts (#13903) --- packages/backend/src/core/CustomEmojiService.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/core/CustomEmojiService.ts b/packages/backend/src/core/CustomEmojiService.ts index 1c75566755..b1feca7fb4 100644 --- a/packages/backend/src/core/CustomEmojiService.ts +++ b/packages/backend/src/core/CustomEmojiService.ts @@ -346,10 +346,11 @@ export class CustomEmojiService implements OnApplicationShutdown { @bindThis public async populateEmojis(emojiNames: string[], noteUserHost: string | null): Promise> { const emojis = await Promise.all(emojiNames.map(x => this.populateEmoji(x, noteUserHost))); - const res = {} as any; + const res = {} as Record; for (let i = 0; i < emojiNames.length; i++) { - if (emojis[i] != null) { - res[emojiNames[i]] = emojis[i]; + const resolvedEmoji = emojis[i]; + if (resolvedEmoji != null) { + res[emojiNames[i]] = resolvedEmoji; } } return res; From eaadd643ebdfb7b9cc5bd04eb68af740ced52c87 Mon Sep 17 00:00:00 2001 From: zyoshoka <107108195+zyoshoka@users.noreply.github.com> Date: Wed, 29 May 2024 20:57:48 +0900 Subject: [PATCH 4/9] chore(misskey-js): fix `repository` and add `license` in `package.json` (#13902) --- packages/misskey-js/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/misskey-js/package.json b/packages/misskey-js/package.json index 6badc7f3ee..f496d8bb1d 100644 --- a/packages/misskey-js/package.json +++ b/packages/misskey-js/package.json @@ -3,6 +3,7 @@ "name": "misskey-js", "version": "2024.3.1", "description": "Misskey SDK for JavaScript", + "license": "MIT", "main": "./built/index.js", "types": "./built/index.d.ts", "exports": { @@ -30,7 +31,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/misskey-dev/misskey.js.git" + "url": "https://github.com/misskey-dev/misskey.git", + "directory": "packages/misskey-js" }, "devDependencies": { "@microsoft/api-extractor": "7.43.1", From 24d4124ffcd3b26d2f9fbec87f917b584f494ece Mon Sep 17 00:00:00 2001 From: KanariKanaru <93921745+kanarikanaru@users.noreply.github.com> Date: Thu, 30 May 2024 17:36:58 +0900 Subject: [PATCH 5/9] =?UTF-8?q?fix(frontend):=20=E3=83=8E=E3=83=BC?= =?UTF-8?q?=E3=83=88=E3=81=AB=E3=83=86=E3=82=AD=E3=82=B9=E3=83=88=E3=81=8C?= =?UTF-8?q?=E3=81=AA=E3=81=8F=E3=81=A6=E3=82=82=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=81=8C5=E3=81=A4=E4=BB=A5=E4=B8=8A=E3=81=82?= =?UTF-8?q?=E3=82=8B=E3=81=A8=E3=81=8D=E3=81=AF=E6=8A=98=E3=82=8A=E3=81=9F?= =?UTF-8?q?=E3=81=9F=E3=82=80=E3=82=88=E3=81=86=E3=81=AB=20(#13907)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: ノートにテキストがなくてもファイルが5つ以上あるときは折りたたむように * 冗長な記述を修正 * Update CHANGELOG.md --- CHANGELOG.md | 1 + packages/frontend/src/scripts/collapsed.ts | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4091668b54..865684aa20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,6 +73,7 @@ - Fix: 通知をグループ化している際に、人数が正常に表示されないことがある問題を修正 - Fix: 連合なしの状態の読み書きができない問題を修正 - Fix: `/share` で日本語等を含むurlがurlエンコードされない問題を修正 +- Fix: ファイルを5つ以上添付してもテキストがないとノートが折りたたまれない問題を修正 ### Server - Enhance: エンドポイント`antennas/update`の必須項目を`antennaId`のみに diff --git a/packages/frontend/src/scripts/collapsed.ts b/packages/frontend/src/scripts/collapsed.ts index 237bd37c7a..4ec88a3c65 100644 --- a/packages/frontend/src/scripts/collapsed.ts +++ b/packages/frontend/src/scripts/collapsed.ts @@ -6,15 +6,16 @@ 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) + 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.length >= 5 ); return collapsed; From ac4a001e9f193e4727a8e65e59978a9464a56d75 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Fri, 31 May 2024 10:11:11 +0900 Subject: [PATCH 6/9] fix code style --- .../MkCustomEmojiDetailedDialog.vue | 108 +++++++++--------- 1 file changed, 56 insertions(+), 52 deletions(-) diff --git a/packages/frontend/src/components/MkCustomEmojiDetailedDialog.vue b/packages/frontend/src/components/MkCustomEmojiDetailedDialog.vue index 84b5375a41..c7f1288729 100644 --- a/packages/frontend/src/components/MkCustomEmojiDetailedDialog.vue +++ b/packages/frontend/src/components/MkCustomEmojiDetailedDialog.vue @@ -4,77 +4,81 @@ SPDX-License-Identifier: AGPL-3.0-only -->