Merge pull request #88 from Fab1en/features/fabien/87-channel-change-not-shown

[fix #87] Channel update event has no "actor" argument
This commit is contained in:
Jonas Herzig 2020-04-14 23:47:46 +02:00 committed by GitHub
commit c3c05ee76a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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')