From f6ff3b1f1a7047a29337575c08849be99ac15a4b Mon Sep 17 00:00:00 2001 From: 1STEP621 <86859447+1STEP621@users.noreply.github.com> Date: Mon, 18 Dec 2023 19:49:19 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20Renote=E3=81=AE=E5=88=A4=E5=AE=9A?= =?UTF-8?q?=E3=81=8C=E9=96=93=E9=81=95=E3=81=A3=E3=81=A6=E3=81=84=E3=82=8B?= =?UTF-8?q?=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=20(#12706)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * RNと引用RNの判定が間違っているのを修正 * remove dump.rdb * update CHANGELOG.md * lint fix --- CHANGELOG.md | 2 ++ packages/backend/src/core/NoteCreateService.ts | 11 ++++++++--- packages/frontend/src/components/MkCwButton.vue | 2 ++ packages/frontend/src/components/MkNote.vue | 3 ++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d6df0a167..6a99a6ca2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,8 @@ - Fix: ノート中の絵文字をタップして「リアクションする」からリアクションした際にリアクションサウンドが鳴らない不具合を修正 - Fix: ノート中のリアクションの表示を微調整 #12650 - Fix: AiScriptの`readline`が不正な値を返すことがある問題を修正 +- Fix: 投票のみ/画像のみの引用RNが、通知欄でただのRNとして判定されるバグを修正 +- Fix: CWをつけて引用RNしても、普通のRNとして扱われてしまうバグを修正しました。 ### Server - Enhance: MFM `$[ruby ]` が他ソフトウェアと連合されるように diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 45dfbb87aa..9fe965b139 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -293,7 +293,7 @@ export class NoteCreateService implements OnApplicationShutdown { } // Check blocking - if (data.renote && data.text == null && data.poll == null && (data.files == null || data.files.length === 0)) { + if (data.renote && this.isQuote(data)) { if (data.renote.userHost === null) { if (data.renote.userId !== user.id) { const blocked = await this.userBlockingService.checkBlocked(data.renote.userId, user.id); @@ -622,7 +622,7 @@ export class NoteCreateService implements OnApplicationShutdown { // If it is renote if (data.renote) { - const type = data.text ? 'quote' : 'renote'; + const type = this.isQuote(data) ? 'quote' : 'renote'; // Notify if (data.renote.userHost === null) { @@ -729,6 +729,11 @@ export class NoteCreateService implements OnApplicationShutdown { return false; } + @bindThis + private isQuote(note: Option): boolean { + return !!note.text || !!note.cw || !!note.files || !!note.poll; + } + @bindThis private incRenoteCount(renote: MiNote) { this.notesRepository.createQueryBuilder().update() @@ -794,7 +799,7 @@ export class NoteCreateService implements OnApplicationShutdown { private async renderNoteOrRenoteActivity(data: Option, note: MiNote) { if (data.localOnly) return null; - const content = data.renote && data.text == null && data.poll == null && (data.files == null || data.files.length === 0) + const content = data.renote && this.isQuote(data) ? this.apRendererService.renderAnnounce(data.renote.uri ? data.renote.uri : `${this.config.url}/notes/${data.renote.id}`, note) : this.apRendererService.renderCreate(await this.apRendererService.renderNote(note, false), note); diff --git a/packages/frontend/src/components/MkCwButton.vue b/packages/frontend/src/components/MkCwButton.vue index 70b7bc8295..a25193a57c 100644 --- a/packages/frontend/src/components/MkCwButton.vue +++ b/packages/frontend/src/components/MkCwButton.vue @@ -17,6 +17,7 @@ import MkButton from '@/components/MkButton.vue'; const props = defineProps<{ modelValue: boolean; text: string | null; + renote: Misskey.entities.Note | null; files: Misskey.entities.DriveFile[]; poll?: { expiresAt: string | null; @@ -41,6 +42,7 @@ const emit = defineEmits<{ const label = computed(() => { return concat([ props.text ? [i18n.t('_cw.chars', { count: props.text.length })] : [], + props.renote != null ? [i18n.ts.quote] : [], props.files.length !== 0 ? [i18n.t('_cw.files', { count: props.files.length })] : [], props.poll != null ? [i18n.ts.poll] : [], ] as string[][]).join(' / '); diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index e723198a17..609b381598 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -54,7 +54,7 @@ SPDX-License-Identifier: AGPL-3.0-only

- +

@@ -229,6 +229,7 @@ if (noteViewInterruptors.length > 0) { const isRenote = ( note.value.renote != null && note.value.text == null && + note.value.cw == null && note.value.fileIds.length === 0 && note.value.poll == null );