mirror of
https://github.com/thelounge/thelounge
synced 2024-11-21 19:43:07 +00:00
publicClient: add FIXME and ignore the type mismatch
The publicClient interface is utterly horrific. It allows any client to inject arbitrary events into the socket.io event stream. This should get wrapped into a "plugin" event so that it can get properly typed, better yet, this should get removed completely.
This commit is contained in:
parent
1c4ce5d4a5
commit
c20cd6bda1
1 changed files with 4 additions and 1 deletions
|
@ -36,8 +36,11 @@ export default class PublicClient {
|
|||
* @param {String} event - Name of the event, must be something the browser will recognise
|
||||
* @param {Object} data - Body of the event, can be anything, but will need to be properly interpreted by the client
|
||||
*/
|
||||
// FIXME: this is utterly bonkers
|
||||
// This needs to get wrapped into its own, typed plugin event
|
||||
// Plus it is completely insane to let a plugin inject arbitrary events like that
|
||||
sendToBrowser(event: string, data) {
|
||||
this.client.emit(event, data);
|
||||
this.client.emit(event as any, data as any);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue