fix: matching on channel is done on full channel path not just channel name

This commit is contained in:
encrypt 2020-03-15 22:30:02 +01:00
parent ac6e230c26
commit c831b13716

View file

@ -362,15 +362,14 @@ class GlobalBindings {
window.matrixWidget.setAlwaysOnScreen(true) window.matrixWidget.setAlwaysOnScreen(true)
// Register all channels, recursively // Register all channels, recursively
const registerChannel = channel => { const registerChannel = (channel, channelPath) => {
this._newChannel(channel) this._newChannel(channel)
// join channel if(channelPath === channelName) {
if (channel.name === channelName) {
client.self.setChannel(channel) client.self.setChannel(channel)
} }
channel.children.forEach(registerChannel) channel.children.forEach(ch => registerChannel(ch, channelPath+"/"+ch.name))
} }
registerChannel(client.root) registerChannel(client.root, "")
// Register all users // Register all users
client.users.forEach(user => this._newUser(user)) client.users.forEach(user => this._newUser(user))