Skip to content
Snippets Groups Projects
Unverified Commit 06ddc8ec authored by MeiMei's avatar MeiMei Committed by GitHub
Browse files

Fix: mainStreamのミュート情報が再接続まで反映されない (#6072)

parent 15289350
No related branches found
No related tags found
No related merge requests found
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment