File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
src/components/structures Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ module.exports = React.createClass({
223
223
// FIXME: if incrementally typing, keep narrowing down the search set
224
224
// incrementally rather than starting over each time.
225
225
if ( this . state . filterByNetwork ) {
226
- if ( this . _networkForRoom ( a ) != this . state . filterByNetwork ) return false ;
226
+ if ( ! this . _isRoomInNetwork ( a , this . state . filterByNetwork ) ) return false ;
227
227
}
228
228
229
229
return ( ( ( a . name && a . name . toLowerCase ( ) . search ( filter . toLowerCase ( ) ) >= 0 ) ||
@@ -301,16 +301,14 @@ module.exports = React.createClass({
301
301
* Terrible temporary function that guess what network a public room
302
302
* entry is in, until synapse is able to tell us
303
303
*/
304
- _networkForRoom ( room ) {
305
- if ( room . aliases ) {
304
+ _isRoomInNetwork ( room , network ) {
305
+ if ( room . aliases && this . networkPatterns [ network ] ) {
306
306
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 ;
310
308
}
311
309
}
312
310
313
- return 'matrix:matrix_org' ;
311
+ return false ;
314
312
} ,
315
313
316
314
render : function ( ) {
You can’t perform that action at this time.
0 commit comments