mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
add id to room.control.host.
This commit is contained in:
parent
2536b49568
commit
7998018cb8
@ -36,7 +36,7 @@ export interface NekoEvents {
|
||||
['session.updated']: (id: string) => void
|
||||
|
||||
// room events
|
||||
['room.control.host']: (hasHost: boolean, hostID?: string) => void
|
||||
['room.control.host']: (hasHost: boolean, hostID: string | undefined, id: string) => void
|
||||
['room.screen.updated']: (width: number, height: number, rate: number, id: string) => void
|
||||
['room.settings.updated']: (settings: Settings, id: string) => void
|
||||
['room.clipboard.updated']: (text: string) => void
|
||||
@ -263,7 +263,7 @@ export class NekoMessages extends EventEmitter<NekoEvents> {
|
||||
// Control Events
|
||||
/////////////////////////////
|
||||
|
||||
protected [EVENT.CONTROL_HOST]({ has_host, host_id }: message.ControlHost) {
|
||||
protected [EVENT.CONTROL_HOST]({ has_host, host_id, id }: message.ControlHost) {
|
||||
this._localLog.debug(`EVENT.CONTROL_HOST`)
|
||||
|
||||
if (has_host && host_id) {
|
||||
@ -275,7 +275,7 @@ export class NekoMessages extends EventEmitter<NekoEvents> {
|
||||
// save if user is host
|
||||
this._state.control.is_host = has_host && this._state.control.host_id === this._state.session_id // TODO: Vue.Set
|
||||
|
||||
this.emit('room.control.host', has_host, host_id)
|
||||
this.emit('room.control.host', has_host, host_id, id)
|
||||
}
|
||||
|
||||
/////////////////////////////
|
||||
|
@ -111,6 +111,7 @@ export interface SessionCursor {
|
||||
/////////////////////////////
|
||||
|
||||
export interface ControlHost {
|
||||
id: string
|
||||
has_host: boolean
|
||||
host_id: string | undefined
|
||||
}
|
||||
|
@ -494,8 +494,8 @@ onMounted(() => {
|
||||
//
|
||||
// room events
|
||||
//
|
||||
neko.value!.events.on('room.control.host', (hasHost: boolean, hostID?: string) => {
|
||||
console.log('room.control.host', hasHost, hostID)
|
||||
neko.value!.events.on('room.control.host', (hasHost: boolean, hostID: string | undefined, id: string) => {
|
||||
console.log('room.control.host', hasHost, hostID, 'by', id)
|
||||
})
|
||||
neko.value!.events.on('room.screen.updated', (width: number, height: number, rate: number, id: string) => {
|
||||
console.log('room.screen.updated', width, height, rate, 'by', id)
|
||||
|
Loading…
Reference in New Issue
Block a user