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

View file

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