From 0ab59a10b32a7701f9c30ddf58b9dbf74551398f Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 11 Feb 2022 19:44:56 +0900 Subject: [PATCH 01/11] fix(client): word mute cannot save --- CHANGELOG.md | 8 ++++++++ packages/client/src/pages/settings/word-mute.vue | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b1ac4fb0..85000e579 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,14 @@ You should also include the user name that made the change. --> +## 12.x.x (unreleased) + +### Improvements +- + +### Bugfixes +- クライアント: ワードミュートが保存できない問題を修正 @syuilo + ## 12.106.0 (2022/02/11) ### Improvements diff --git a/packages/client/src/pages/settings/word-mute.vue b/packages/client/src/pages/settings/word-mute.vue index bdccd7f1e..2767e6351 100644 --- a/packages/client/src/pages/settings/word-mute.vue +++ b/packages/client/src/pages/settings/word-mute.vue @@ -102,7 +102,7 @@ export default defineComponent({ let lines = mutes.trim().split('\n').map(line => line.trim()).filter(line => line != ''); // check each line if it is a RegExp or not - for(let i = 0; i < lines.length; i++) { + for (let i = 0; i < lines.length; i++) { const line = lines[i] const regexp = line.match(/^\/(.+)\/(.*)$/); if (regexp) { @@ -124,6 +124,8 @@ export default defineComponent({ lines[i] = line.split(' '); } } + + return lines; }; let softMutes, hardMutes; From fd5a304821ed71d52176ce714d3d6f0579ffcad5 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 11 Feb 2022 19:47:30 +0900 Subject: [PATCH 02/11] 12.106.1 --- CHANGELOG.md | 5 +---- package.json | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85000e579..21bf164e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,7 @@ You should also include the user name that made the change. --> -## 12.x.x (unreleased) - -### Improvements -- +## 12.106.1 (2022/02/11) ### Bugfixes - クライアント: ワードミュートが保存できない問題を修正 @syuilo diff --git a/package.json b/package.json index 19ea4ef9a..964aff2cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.106.0", + "version": "12.106.1", "codename": "indigo", "repository": { "type": "git", From c456825d0ea49134a685248d580d346357aa923a Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 11 Feb 2022 21:06:38 +0900 Subject: [PATCH 03/11] Update 1644010796173-convert-hard-mutes.js --- packages/backend/migration/1644010796173-convert-hard-mutes.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/backend/migration/1644010796173-convert-hard-mutes.js b/packages/backend/migration/1644010796173-convert-hard-mutes.js index f06da6567..9f2e9643e 100644 --- a/packages/backend/migration/1644010796173-convert-hard-mutes.js +++ b/packages/backend/migration/1644010796173-convert-hard-mutes.js @@ -9,6 +9,7 @@ module.exports = class convertHardMutes1644010796173 { for(let i = 0; i < entries.length; i++) { let words = entries[i].mutedWords .map(line => { + if (typeof line === 'string') return []; const regexp = line.join(" ").match(/^\/(.+)\/(.*)$/); if (regexp) { // convert regexp's From 9f9b8d1cae861cb2b8064ebb20796813c1d86867 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 11 Feb 2022 21:17:07 +0900 Subject: [PATCH 04/11] Update 1644010796173-convert-hard-mutes.js --- packages/backend/migration/1644010796173-convert-hard-mutes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/migration/1644010796173-convert-hard-mutes.js b/packages/backend/migration/1644010796173-convert-hard-mutes.js index 9f2e9643e..6169cb014 100644 --- a/packages/backend/migration/1644010796173-convert-hard-mutes.js +++ b/packages/backend/migration/1644010796173-convert-hard-mutes.js @@ -5,7 +5,7 @@ module.exports = class convertHardMutes1644010796173 { name = 'convertHardMutes1644010796173' async up(queryRunner) { - let entries = await queryRunner.query(`SELECT "userId", "mutedWords" FROM "user_profile"`); + let entries = await queryRunner.query(`SELECT "userId", "mutedWords" FROM "user_profile" WHERE "userHost" IS NULL`); for(let i = 0; i < entries.length; i++) { let words = entries[i].mutedWords .map(line => { From b3decdc4e5c34aa3b76d79855053a299897555eb Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 11 Feb 2022 21:35:28 +0900 Subject: [PATCH 05/11] =?UTF-8?q?fix(client):=20=E3=83=8E=E3=83=BC?= =?UTF-8?q?=E3=83=88=E3=81=AE=E5=8F=82=E7=85=A7=E3=82=92=E6=96=AD=E3=81=A1?= =?UTF-8?q?=E5=88=87=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #8201 Close #8237 --- CHANGELOG.md | 9 +++++ packages/client/src/components/note.vue | 23 +++++++------ .../client/src/scripts/use-note-capture.ts | 33 ++++++++++--------- 3 files changed, 39 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21bf164e5..47fa72b62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,15 @@ You should also include the user name that made the change. --> +## 12.x.x (unreleased) + +### Improvements +- + +### Bugfixes +- クライアント: 削除したノートがタイムラインから自動で消えない問題を修正 @syuilo +- クライアント: リアクション数が正しくないことがある問題を修正 @syuilo + ## 12.106.1 (2022/02/11) ### Bugfixes diff --git a/packages/client/src/components/note.vue b/packages/client/src/components/note.vue index 6c596fb60..7cf5fb047 100644 --- a/packages/client/src/components/note.vue +++ b/packages/client/src/components/note.vue @@ -138,11 +138,13 @@ const props = defineProps<{ const inChannel = inject('inChannel', null); +const note = $ref(JSON.parse(JSON.stringify(props.note))); + const isRenote = ( - props.note.renote != null && - props.note.text == null && - props.note.fileIds.length === 0 && - props.note.poll == null + note.renote != null && + note.text == null && + note.fileIds.length === 0 && + note.poll == null ); const el = ref(); @@ -150,8 +152,8 @@ const menuButton = ref(); const renoteButton = ref>(); const renoteTime = ref(); const reactButton = ref(); -let appearNote = $ref(isRenote ? props.note.renote as misskey.entities.Note : props.note); -const isMyRenote = $i && ($i.id === props.note.userId); +let appearNote = $ref(isRenote ? note.renote as misskey.entities.Note : note); +const isMyRenote = $i && ($i.id === note.userId); const showContent = ref(false); const collapsed = ref(appearNote.cw == null && appearNote.text != null && ( (appearNote.text.split('\n').length > 9) || @@ -176,8 +178,9 @@ const keymap = { }; useNoteCapture({ - appearNote: $$(appearNote), rootEl: el, + note: $$(appearNote), + isDeletedRef: $$(isDeleted), }); function reply(viaKeyboard = false): void { @@ -225,12 +228,12 @@ function onContextmenu(ev: MouseEvent): void { ev.preventDefault(); react(); } else { - os.contextMenu(getNoteMenu({ note: props.note, translating, translation, menuButton }), ev).then(focus); + os.contextMenu(getNoteMenu({ note: note, translating, translation, menuButton }), ev).then(focus); } } function menu(viaKeyboard = false): void { - os.popupMenu(getNoteMenu({ note: props.note, translating, translation, menuButton }), menuButton.value, { + os.popupMenu(getNoteMenu({ note: note, translating, translation, menuButton }), menuButton.value, { viaKeyboard }).then(focus); } @@ -243,7 +246,7 @@ function showRenoteMenu(viaKeyboard = false): void { danger: true, action: () => { os.api('notes/delete', { - noteId: props.note.id + noteId: note.id }); isDeleted.value = true; } diff --git a/packages/client/src/scripts/use-note-capture.ts b/packages/client/src/scripts/use-note-capture.ts index b7cf99d5e..b2a96062c 100644 --- a/packages/client/src/scripts/use-note-capture.ts +++ b/packages/client/src/scripts/use-note-capture.ts @@ -5,34 +5,35 @@ import { $i } from '@/account'; export function useNoteCapture(props: { rootEl: Ref; - appearNote: Ref; + note: Ref; + isDeletedRef: Ref; }) { - const appearNote = props.appearNote; + const note = props.note; const connection = $i ? stream : null; function onStreamNoteUpdated(data): void { const { type, id, body } = data; - if (id !== appearNote.value.id) return; + if (id !== note.value.id) return; switch (type) { case 'reacted': { const reaction = body.reaction; if (body.emoji) { - const emojis = appearNote.value.emojis || []; + const emojis = note.value.emojis || []; if (!emojis.includes(body.emoji)) { - appearNote.value.emojis = [...emojis, body.emoji]; + note.value.emojis = [...emojis, body.emoji]; } } // TODO: reactionsプロパティがない場合ってあったっけ? なければ || {} は消せる - const currentCount = (appearNote.value.reactions || {})[reaction] || 0; + const currentCount = (note.value.reactions || {})[reaction] || 0; - appearNote.value.reactions[reaction] = currentCount + 1; + note.value.reactions[reaction] = currentCount + 1; if ($i && (body.userId === $i.id)) { - appearNote.value.myReaction = reaction; + note.value.myReaction = reaction; } break; } @@ -41,12 +42,12 @@ export function useNoteCapture(props: { const reaction = body.reaction; // TODO: reactionsプロパティがない場合ってあったっけ? なければ || {} は消せる - const currentCount = (appearNote.value.reactions || {})[reaction] || 0; + const currentCount = (note.value.reactions || {})[reaction] || 0; - appearNote.value.reactions[reaction] = Math.max(0, currentCount - 1); + note.value.reactions[reaction] = Math.max(0, currentCount - 1); if ($i && (body.userId === $i.id)) { - appearNote.value.myReaction = null; + note.value.myReaction = null; } break; } @@ -54,7 +55,7 @@ export function useNoteCapture(props: { case 'pollVoted': { const choice = body.choice; - const choices = [...appearNote.value.poll.choices]; + const choices = [...note.value.poll.choices]; choices[choice] = { ...choices[choice], votes: choices[choice].votes + 1, @@ -63,12 +64,12 @@ export function useNoteCapture(props: { } : {}) }; - appearNote.value.poll.choices = choices; + note.value.poll.choices = choices; break; } case 'deleted': { - appearNote.value.deletedAt = new Date(); + props.isDeletedRef.value = true; break; } } @@ -77,7 +78,7 @@ export function useNoteCapture(props: { function capture(withHandler = false): void { if (connection) { // TODO: このノートがストリーミング経由で流れてきた場合のみ sr する - connection.send(document.body.contains(props.rootEl.value) ? 'sr' : 's', { id: appearNote.value.id }); + connection.send(document.body.contains(props.rootEl.value) ? 'sr' : 's', { id: note.value.id }); if (withHandler) connection.on('noteUpdated', onStreamNoteUpdated); } } @@ -85,7 +86,7 @@ export function useNoteCapture(props: { function decapture(withHandler = false): void { if (connection) { connection.send('un', { - id: appearNote.value.id, + id: note.value.id, }); if (withHandler) connection.off('noteUpdated', onStreamNoteUpdated); } From 64874417e013965ecc6549ae73d0139e6c1e0174 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 11 Feb 2022 21:37:19 +0900 Subject: [PATCH 06/11] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47fa72b62..eb61ee250 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ You should also include the user name that made the change. ### Bugfixes - クライアント: 削除したノートがタイムラインから自動で消えない問題を修正 @syuilo - クライアント: リアクション数が正しくないことがある問題を修正 @syuilo +- 一部環境でマイグレーションが動作しない問題を修正 @syuilo ## 12.106.1 (2022/02/11) From ed382330449a1e5fa0d55615a571fc0f137856dc Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 11 Feb 2022 21:38:17 +0900 Subject: [PATCH 07/11] New Crowdin updates (#8304) * New translations ja-JP.yml (Chinese Simplified) * New translations ja-JP.yml (Chinese Simplified) --- locales/zh-CN.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index 568470c7b..86d3fb5cd 100644 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -831,6 +831,8 @@ smartphone: "智能手机" tablet: "平板" auto: "自动" themeColor: "主题颜色" +size: "大小" +numberOfColumn: "列数" _emailUnavailable: used: "已经被使用过" format: "无效的格式" @@ -958,7 +960,7 @@ _mfm: rotateDescription: "旋转指定的角度。" _instanceTicker: none: "不显示" - remote: "显示给远程用户" + remote: "仅显示远程用户的" always: "始终显示" _serverDisconnectedBehavior: reload: "自动重载" From de6e3d64b42e56d6cba289d21c57063443e26563 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 11 Feb 2022 21:40:04 +0900 Subject: [PATCH 08/11] 12.106.2 --- CHANGELOG.md | 5 +---- package.json | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb61ee250..81981e8ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,7 @@ You should also include the user name that made the change. --> -## 12.x.x (unreleased) - -### Improvements -- +## 12.106.2 (2022/02/11) ### Bugfixes - クライアント: 削除したノートがタイムラインから自動で消えない問題を修正 @syuilo diff --git a/package.json b/package.json index 964aff2cf..dbf3f2e00 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.106.1", + "version": "12.106.2", "codename": "indigo", "repository": { "type": "git", From b01a0325ba8b682da7fc44764d6abb9c320aa90e Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 11 Feb 2022 22:14:14 +0900 Subject: [PATCH 09/11] =?UTF-8?q?fix(client):=20=E3=83=8E=E3=83=BC?= =?UTF-8?q?=E3=83=88=E8=A9=B3=E7=B4=B0=E3=81=8C=E9=96=8B=E3=81=91=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=AE=E3=82=92=E7=9B=B4=E3=81=97=E3=81=9F=E3=82=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #8305 --- CHANGELOG.md | 8 +++++++ .../client/src/components/note-detailed.vue | 23 +++++++++++-------- packages/client/src/components/note.vue | 2 +- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81981e8ae..1a396102b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,14 @@ You should also include the user name that made the change. --> +## 12.x.x (unreleased) + +### Improvements +- + +### Bugfixes +- クライアント: ノートの詳細が表示されない問題を修正 @syuilo + ## 12.106.2 (2022/02/11) ### Bugfixes diff --git a/packages/client/src/components/note-detailed.vue b/packages/client/src/components/note-detailed.vue index 5fc3a0f33..80233d608 100644 --- a/packages/client/src/components/note-detailed.vue +++ b/packages/client/src/components/note-detailed.vue @@ -154,11 +154,13 @@ const props = defineProps<{ const inChannel = inject('inChannel', null); +const note = $ref(JSON.parse(JSON.stringify(props.note))); + const isRenote = ( - props.note.renote != null && - props.note.text == null && - props.note.fileIds.length === 0 && - props.note.poll == null + note.renote != null && + note.text == null && + note.fileIds.length === 0 && + note.poll == null ); const el = ref(); @@ -166,8 +168,8 @@ const menuButton = ref(); const renoteButton = ref>(); const renoteTime = ref(); const reactButton = ref(); -let appearNote = $ref(isRenote ? props.note.renote as misskey.entities.Note : props.note); -const isMyRenote = $i && ($i.id === props.note.userId); +let appearNote = $ref(isRenote ? note.renote as misskey.entities.Note : note); +const isMyRenote = $i && ($i.id === note.userId); const showContent = ref(false); const isDeleted = ref(false); const muted = ref(checkWordMute(appearNote, $i, defaultStore.state.mutedWords)); @@ -188,8 +190,9 @@ const keymap = { }; useNoteCapture({ - appearNote: $$(appearNote), rootEl: el, + note: $$(appearNote), + isDeletedRef: isDeleted, }); function reply(viaKeyboard = false): void { @@ -237,12 +240,12 @@ function onContextmenu(ev: MouseEvent): void { ev.preventDefault(); react(); } else { - os.contextMenu(getNoteMenu({ note: props.note, translating, translation, menuButton }), ev).then(focus); + os.contextMenu(getNoteMenu({ note: note, translating, translation, menuButton }), ev).then(focus); } } function menu(viaKeyboard = false): void { - os.popupMenu(getNoteMenu({ note: props.note, translating, translation, menuButton }), menuButton.value, { + os.popupMenu(getNoteMenu({ note: note, translating, translation, menuButton }), menuButton.value, { viaKeyboard }).then(focus); } @@ -255,7 +258,7 @@ function showRenoteMenu(viaKeyboard = false): void { danger: true, action: () => { os.api('notes/delete', { - noteId: props.note.id + noteId: note.id }); isDeleted.value = true; } diff --git a/packages/client/src/components/note.vue b/packages/client/src/components/note.vue index 7cf5fb047..93286a28b 100644 --- a/packages/client/src/components/note.vue +++ b/packages/client/src/components/note.vue @@ -180,7 +180,7 @@ const keymap = { useNoteCapture({ rootEl: el, note: $$(appearNote), - isDeletedRef: $$(isDeleted), + isDeletedRef: isDeleted, }); function reply(viaKeyboard = false): void { From c1f0fa5bd6b2f6b5f8c46375bc32e54c9c985844 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 11 Feb 2022 22:16:20 +0900 Subject: [PATCH 10/11] enhance(client): tweak padding --- CHANGELOG.md | 2 +- packages/client/src/components/global/spacer.vue | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a396102b..dfed918d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ You should also include the user name that made the change. ## 12.x.x (unreleased) ### Improvements -- +- クライアント: スマートフォンでの余白を調整 @syuilo ### Bugfixes - クライアント: ノートの詳細が表示されない問題を修正 @syuilo diff --git a/packages/client/src/components/global/spacer.vue b/packages/client/src/components/global/spacer.vue index 8a1d7a4e8..f2eda1907 100644 --- a/packages/client/src/components/global/spacer.vue +++ b/packages/client/src/components/global/spacer.vue @@ -7,6 +7,7 @@