remove legacy websocket endpoints.

This commit is contained in:
Miroslav Šedivý 2020-11-28 15:08:07 +01:00
parent 3261cf663a
commit bc443cb3a0
3 changed files with 1 additions and 84 deletions

View File

@ -310,24 +310,6 @@
this.neko.events.on('broadcast.status', (payload) => {
console.log('broadcast.status', payload)
})
this.neko.events.on('member.ban', (id, target) => {
console.log('member.ban', id, target)
})
this.neko.events.on('member.kick', (id, target) => {
console.log('member.kick', id, target)
})
this.neko.events.on('member.muted', (id, target) => {
console.log('member.muted', id, target)
})
this.neko.events.on('member.unmuted', (id, target) => {
console.log('member.unmuted', id, target)
})
this.neko.events.on('room.locked', (id) => {
console.log('room.locked', id)
})
this.neko.events.on('room.unlocked', (id) => {
console.log('room.unlocked', id)
})
}
}
</script>

View File

@ -34,12 +34,6 @@ export interface NekoEvents {
['clipboard.update']: (text: string) => void
['screen.size']: (id: string) => void
['broadcast.status']: (url: string, isActive: boolean) => void
['member.ban']: (id: string, target: string) => void
['member.kick']: (id: string, target: string) => void
['member.muted']: (id: string, target: string) => void
['member.unmuted']: (id: string, target: string) => void
['room.locked']: (id: string) => void
['room.unlocked']: (id: string) => void
}
export class NekoMessages extends EventEmitter<NekoEvents> {
@ -182,50 +176,6 @@ export class NekoMessages extends EventEmitter<NekoEvents> {
/////////////////////////////
// Admin Events
/////////////////////////////
protected [EVENT.ADMIN.BAN]({ id, target }: AdminTargetPayload) {
if (!target) return
console.log('EVENT.ADMIN.BAN')
this.emit('member.ban', id, target)
// TODO
}
protected [EVENT.ADMIN.KICK]({ id, target }: AdminTargetPayload) {
if (!target) return
console.log('EVENT.ADMIN.KICK')
this.emit('member.kick', id, target)
// TODO
}
protected [EVENT.ADMIN.MUTE]({ id, target }: AdminTargetPayload) {
if (!target) return
console.log('EVENT.ADMIN.MUTE')
this.emit('member.muted', id, target)
//user.setMuted({ id: target, muted: true })
}
protected [EVENT.ADMIN.UNMUTE]({ id, target }: AdminTargetPayload) {
if (!target) return
console.log('EVENT.ADMIN.UNMUTE')
this.emit('member.unmuted', id, target)
//user.setMuted({ id: target, muted: false })
}
protected [EVENT.ADMIN.LOCK]({ id }: AdminPayload) {
console.log('EVENT.ADMIN.LOCK')
this.emit('room.locked', id)
//setLocked(true)
}
protected [EVENT.ADMIN.UNLOCK]({ id }: AdminPayload) {
console.log('EVENT.ADMIN.UNLOCK')
this.emit('room.unlocked', id)
//setLocked(false)
}
protected [EVENT.ADMIN.CONTROL]({ id, target }: AdminTargetPayload) {
if (!target) return

View File

@ -31,12 +31,6 @@ export const EVENT = {
DESTROY: 'broadcast/destroy',
},
ADMIN: {
BAN: 'admin/ban',
KICK: 'admin/kick',
MUTE: 'admin/mute',
UNMUTE: 'admin/unmute',
LOCK: 'admin/lock',
UNLOCK: 'admin/unlock',
CONTROL: 'admin/control',
RELEASE: 'admin/release',
GIVE: 'admin/give',
@ -75,13 +69,4 @@ export type BroadcastEvents =
| typeof EVENT.BROADCAST.CREATE
| typeof EVENT.BROADCAST.DESTROY
export type AdminEvents =
| typeof EVENT.ADMIN.BAN
| typeof EVENT.ADMIN.KICK
| typeof EVENT.ADMIN.LOCK
| typeof EVENT.ADMIN.UNLOCK
| typeof EVENT.ADMIN.MUTE
| typeof EVENT.ADMIN.UNMUTE
| typeof EVENT.ADMIN.CONTROL
| typeof EVENT.ADMIN.RELEASE
| typeof EVENT.ADMIN.GIVE
export type AdminEvents = typeof EVENT.ADMIN.CONTROL | typeof EVENT.ADMIN.RELEASE | typeof EVENT.ADMIN.GIVE