From 9b07c5af05a8be8114af860893d68614e4ee5ca2 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Tue, 14 Apr 2020 00:42:59 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AA=E3=83=A2=E3=83=BC=E3=83=88=E3=81=AE?= =?UTF-8?q?=E3=82=AB=E3=82=B9=E3=82=BF=E3=83=A0=E7=B5=B5=E6=96=87=E5=AD=97?= =?UTF-8?q?=E3=83=AA=E3=82=A2=E3=82=AF=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=20(#6239)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * リモートのカスタム絵文字リアクションを表示できるように * AP * DBマイグレーション * ローカルのリアクションの. * fix * fix * fix * space --- migration/1586641139527-remote-reaction.ts | 12 ++++ src/client/components/note.vue | 8 +++ src/client/components/notification.vue | 2 +- src/client/components/reaction-icon.vue | 6 +- .../components/reactions-viewer.reaction.vue | 2 +- src/misc/reaction-lib.ts | 59 ++++++++++++++-- src/models/entities/note-reaction.ts | 2 +- src/models/repositories/note.ts | 68 ++++++++++++++----- src/remote/activitypub/kernel/like.ts | 4 +- src/remote/activitypub/renderer/like.ts | 34 +++++++--- src/services/note/reaction/create.ts | 27 ++++++-- src/services/note/reaction/delete.ts | 2 +- 12 files changed, 185 insertions(+), 41 deletions(-) create mode 100644 migration/1586641139527-remote-reaction.ts diff --git a/migration/1586641139527-remote-reaction.ts b/migration/1586641139527-remote-reaction.ts new file mode 100644 index 000000000..5a7fb36e3 --- /dev/null +++ b/migration/1586641139527-remote-reaction.ts @@ -0,0 +1,12 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class remoteReaction1586641139527 implements MigrationInterface { + name = 'remoteReaction1586641139527' + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "note_reaction" ALTER COLUMN "reaction" TYPE character varying(260)`, undefined); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "note_reaction" ALTER COLUMN "reaction" TYPE character varying(130)`, undefined); + } +} diff --git a/src/client/components/note.vue b/src/client/components/note.vue index 18d5cc34b..a39520fb4 100644 --- a/src/client/components/note.vue +++ b/src/client/components/note.vue @@ -301,6 +301,14 @@ export default Vue.extend({ case 'reacted': { const reaction = body.reaction; + if (body.emoji) { + const emojis = this.appearNote.emojis || []; + if (!emojis.includes(body.emoji)) { + emojis.push(body.emoji); + Vue.set(this.appearNote, 'emojis', emojis); + } + } + if (this.appearNote.reactions == null) { Vue.set(this.appearNote, 'reactions', {}); } diff --git a/src/client/components/notification.vue b/src/client/components/notification.vue index f415887e7..97a2fe187 100644 --- a/src/client/components/notification.vue +++ b/src/client/components/notification.vue @@ -12,7 +12,7 @@ - +
diff --git a/src/client/components/reaction-icon.vue b/src/client/components/reaction-icon.vue index 9155c5944..3c6d56b80 100644 --- a/src/client/components/reaction-icon.vue +++ b/src/client/components/reaction-icon.vue @@ -1,5 +1,5 @@