diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-03-21 13:36:41 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-03-21 13:36:41 +0900 |
| commit | 6fb7721798657cf842556fb63f116316365efa74 (patch) | |
| tree | 6917342553156b6483b899eafc66ef8f040b8352 /src/server/api/stream | |
| parent | Update CHANGELOG.md (diff) | |
| parent | 12.22.0 (diff) | |
| download | misskey-6fb7721798657cf842556fb63f116316365efa74.tar.gz misskey-6fb7721798657cf842556fb63f116316365efa74.tar.bz2 misskey-6fb7721798657cf842556fb63f116316365efa74.zip | |
Merge branch 'develop'
Diffstat (limited to 'src/server/api/stream')
| -rw-r--r-- | src/server/api/stream/channels/main.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/server/api/stream/channels/main.ts b/src/server/api/stream/channels/main.ts index 8cd4fcac99..22e664baca 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,14 @@ 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; + const { type } = data; + let { 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 +25,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 |