summaryrefslogtreecommitdiff
path: root/src/server/api/stream/channels
diff options
context:
space:
mode:
authorMeiMei <30769358+mei23@users.noreply.github.com>2020-02-26 08:03:23 +0900
committerGitHub <noreply@github.com>2020-02-26 08:03:23 +0900
commit06ddc8ec506fea622989335d9e2ae2c286903231 (patch)
tree9f11d054ab8b28a129a385deca63de5b8ecad03e /src/server/api/stream/channels
parentGitHub Actionsでテストが動かなくなっているのを修正 (#6088) (diff)
downloadsharkey-06ddc8ec506fea622989335d9e2ae2c286903231.tar.gz
sharkey-06ddc8ec506fea622989335d9e2ae2c286903231.tar.bz2
sharkey-06ddc8ec506fea622989335d9e2ae2c286903231.zip
Fix: mainStreamのミュート情報が再接続まで反映されない (#6072)
Diffstat (limited to 'src/server/api/stream/channels')
-rw-r--r--src/server/api/stream/channels/main.ts8
1 files 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