diff options
Diffstat (limited to 'src/server/api/stream')
| -rw-r--r-- | src/server/api/stream/channels/main.ts | 6 | ||||
| -rw-r--r-- | src/server/api/stream/index.ts | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/server/api/stream/channels/main.ts b/src/server/api/stream/channels/main.ts index a6c5b12760..fd0984c833 100644 --- a/src/server/api/stream/channels/main.ts +++ b/src/server/api/stream/channels/main.ts @@ -14,12 +14,12 @@ export default class extends Channel { switch (type) { case 'notification': { - if (!mutedUserIds.includes(body.userId)) { - this.send('notification', body); - } + if (mutedUserIds.includes(body.userId)) return; break; } } + + this.send(type, body); }); } } diff --git a/src/server/api/stream/index.ts b/src/server/api/stream/index.ts index 743d77b2a3..ef6397fcd9 100644 --- a/src/server/api/stream/index.ts +++ b/src/server/api/stream/index.ts @@ -24,6 +24,7 @@ export default class Connection { public subscriber: Xev; private channels: Channel[] = []; private subscribingNotes: any = {}; + public sendMessageToWsOverride: any = null; // 後方互換性のため constructor( wsConnection: websocket.connection, @@ -164,6 +165,7 @@ export default class Connection { */ @autobind public sendMessageToWs(type: string, payload: any) { + if (this.sendMessageToWsOverride) return this.sendMessageToWsOverride(type, payload); // 後方互換性のため this.wsConnection.send(JSON.stringify({ type: type, body: payload |