From a0f8c7e94ee2de826326a630c783d5c8c39825a7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 26 Jan 2019 17:47:56 +0900 Subject: [PATCH] Resolve #2253 --- CHANGELOG.md | 1 + src/client/app/common/scripts/note-subscriber.ts | 1 + src/services/note/delete.ts | 13 +++++++++++++ 3 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1ba13339..87343664e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ unreleased * 返信するときにCWを維持するかどうか設定できるように * 外部サービス認証情報の配信 * 管理画面のモデレーションのUIを強化 +* 引用投稿を削除したとき単なるRenoteとしてタイムラインに残る問題を修正 * イタリック構文の判定の改善 * テーマが反映されないことがある問題を修正 * ホームにフォロワー限定投稿が表示されない問題を修正 diff --git a/src/client/app/common/scripts/note-subscriber.ts b/src/client/app/common/scripts/note-subscriber.ts index 9545b5406..c2b4dd6df 100644 --- a/src/client/app/common/scripts/note-subscriber.ts +++ b/src/client/app/common/scripts/note-subscriber.ts @@ -133,6 +133,7 @@ export default prop => ({ case 'deleted': { Vue.set(this.$_ns_target, 'deletedAt', body.deletedAt); + Vue.set(this.$_ns_target, 'renote', null); this.$_ns_target.text = null; this.$_ns_target.tags = []; this.$_ns_target.fileIds = []; diff --git a/src/services/note/delete.ts b/src/services/note/delete.ts index 9709eeaf5..e8ce181d5 100644 --- a/src/services/note/delete.ts +++ b/src/services/note/delete.ts @@ -30,12 +30,25 @@ export default async function(user: IUser, note: INote) { text: null, tags: [], fileIds: [], + renoteId: null, poll: null, geo: null, cw: null } }); + if (note.renoteId) { + Note.update({ _id: note.renoteId }, { + $inc: { + renoteCount: -1, + score: -1 + }, + $pull: { + _quoteIds: note._id + } + }); + } + publishNoteStream(note._id, 'deleted', { deletedAt: deletedAt });