From e96e54f7914f6503141664230738142a68ab5c89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Fri, 27 May 2022 00:25:34 +0200 Subject: [PATCH] messages event. --- src/component/internal/messages.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/component/internal/messages.ts b/src/component/internal/messages.ts index 9c5c2da9..94b6f0e3 100644 --- a/src/component/internal/messages.ts +++ b/src/component/internal/messages.ts @@ -39,6 +39,9 @@ export interface NekoEvents { ['room.screen.updated']: (width: number, height: number, rate: number) => void ['room.clipboard.updated']: (text: string) => void ['room.broadcast.status']: (isActive: boolean, url?: string) => void + + // external message events + ['message']: (event: string, payload: any) => void } export class NekoMessages extends EventEmitter { @@ -65,7 +68,8 @@ export class NekoMessages extends EventEmitter { this._remoteLog.error(`error while processing websocket event`, { event, error }) } } else { - this._remoteLog.warn(`unhandled websocket event`, { event, payload }) + this._remoteLog.debug(`emitting external message`, { event, payload }) + this.emit('message', event, payload) } })