Skip to content

Commit cd4564d

Browse files
committed
Make the matrix.org section be everything
(ie. every alias on the matrix.org HS, so currently everything, since we don't pull in any other directories)
1 parent 190cd88 commit cd4564d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/components/structures/RoomDirectory.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ module.exports = React.createClass({
223223
// FIXME: if incrementally typing, keep narrowing down the search set
224224
// incrementally rather than starting over each time.
225225
if (this.state.filterByNetwork) {
226-
if (this._networkForRoom(a) != this.state.filterByNetwork) return false;
226+
if (!this._isRoomInNetwork(a, this.state.filterByNetwork)) return false;
227227
}
228228

229229
return (((a.name && a.name.toLowerCase().search(filter.toLowerCase()) >= 0) ||
@@ -301,16 +301,14 @@ module.exports = React.createClass({
301301
* Terrible temporary function that guess what network a public room
302302
* entry is in, until synapse is able to tell us
303303
*/
304-
_networkForRoom(room) {
305-
if (room.aliases) {
304+
_isRoomInNetwork(room, network) {
305+
if (room.aliases && this.networkPatterns[network]) {
306306
for (const alias of room.aliases) {
307-
for (const network of Object.keys(this.networkPatterns)) {
308-
if (this.networkPatterns[network].test(alias)) return network;
309-
}
307+
if (this.networkPatterns[network].test(alias)) return true;
310308
}
311309
}
312310

313-
return 'matrix:matrix_org';
311+
return false;
314312
},
315313

316314
render: function() {

0 commit comments

Comments
 (0)