Merge pull request #2037 from thelounge/xpaw/fix-1501

Fix queries going to lobby if the network name matches user name
This commit is contained in:
Jérémie Astori 2018-02-05 23:47:55 -05:00 committed by GitHub
commit b213e988ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -133,7 +133,8 @@ Network.prototype.export = function() {
Network.prototype.getChannel = function(name) { Network.prototype.getChannel = function(name) {
name = name.toLowerCase(); name = name.toLowerCase();
return _.find(this.channels, function(that) { return _.find(this.channels, function(that, i) {
return that.name.toLowerCase() === name; // Skip network lobby (it's always unshifted into first position)
return i > 0 && that.name.toLowerCase() === name;
}); });
}; };