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/stream.ts b/src/stream.ts index 4cd8fc8b2c..45b353d904 100644 --- a/src/stream.ts +++ b/src/stream.ts @@ -25,7 +25,7 @@ class Publisher { private publish = (channel: string, type: string, value?: any): void => { const message = type == null ? value : value == null ? - { type: type } : + { type: type, body: null } : { type: type, body: value }; this.ev.emit(channel, message);