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)
// Register all channels, recursively
const registerChannel = channel => {
const registerChannel = (channel, channelPath) => {
this._newChannel(channel)
// join channel
if (channel.name === channelName) {
if(channelPath === channelName) {
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
client.users.forEach(user => this._newUser(user))