From 06ddc8ec506fea622989335d9e2ae2c286903231 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Wed, 26 Feb 2020 08:03:23 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20mainStream=E3=81=AE=E3=83=9F=E3=83=A5?= =?UTF-8?q?=E3=83=BC=E3=83=88=E6=83=85=E5=A0=B1=E3=81=8C=E5=86=8D=E6=8E=A5?= =?UTF-8?q?=E7=B6=9A=E3=81=BE=E3=81=A7=E5=8F=8D=E6=98=A0=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84=20(#6072)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/api/stream/channels/main.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/server/api/stream/channels/main.ts b/src/server/api/stream/channels/main.ts index 8cd4fcac99..7419ba4203 100644 --- a/src/server/api/stream/channels/main.ts +++ b/src/server/api/stream/channels/main.ts @@ -1,6 +1,6 @@ import autobind from 'autobind-decorator'; import Channel from '../channel'; -import { Mutings, Notes } from '../../../../models'; +import { Notes } from '../../../../models'; export default class extends Channel { public readonly chName = 'main'; @@ -9,15 +9,13 @@ export default class extends Channel { @autobind public async init(params: any) { - const mute = await Mutings.find({ muterId: this.user!.id }); - // Subscribe main stream channel this.subscriber.on(`mainStream:${this.user!.id}`, async data => { let { type, body } = data; switch (type) { case 'notification': { - if (mute.map(m => m.muteeId).includes(body.userId)) return; + if (this.muting.includes(body.userId)) return; if (body.note && body.note.isHidden) { body.note = await Notes.pack(body.note.id, this.user, { detail: true @@ -26,7 +24,7 @@ export default class extends Channel { break; } case 'mention': { - if (mute.map(m => m.muteeId).includes(body.userId)) return; + if (this.muting.includes(body.userId)) return; if (body.isHidden) { body = await Notes.pack(body.id, this.user, { detail: true