[fix #87] Channel update event has no "actor" argument

This commit is contained in:
Fabien Quatravaux 2020-04-12 23:46:15 +02:00
parent 5640c6c108
commit 5ff3e593ef
2 changed files with 3 additions and 7 deletions

View file

@ -265,7 +265,7 @@ class WorkerBasedMumbleChannel extends EventEmitter {
_dispatchEvent (name, args) {
if (name === 'update') {
let [actor, props] = args
let [props] = args
Object.entries(props).forEach((entry) => {
this._setProp(entry[0], entry[1])
})
@ -276,7 +276,6 @@ class WorkerBasedMumbleChannel extends EventEmitter {
props.links = this.links
}
args = [
this._client._user(actor),
props
]
} else if (name === 'remove') {

View file

@ -90,17 +90,14 @@ import 'subworkers'
function setupChannel (id, channel) {
id = Object.assign({}, id, { channel: channel.id })
registerEventProxy(id, channel, 'update', (actor, props) => {
if (actor) {
actor = actor.id
}
registerEventProxy(id, channel, 'update', (props) => {
if (props.parent) {
props.parent = props.parent.id
}
if (props.links) {
props.links = props.links.map((it) => it.id)
}
return [actor, props]
return [props]
})
registerEventProxy(id, channel, 'remove')