From c0a457406965012534c22188bab49614fe84a50f Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 4 Oct 2016 15:30:46 +0100 Subject: [PATCH] For single instance, allow domain present & match --- src/components/structures/RoomDirectory.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index ccb4c794c8..d066932fd7 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -508,7 +508,16 @@ module.exports = React.createClass({ // If there's only one instance in this protocol, use it // as long as it has no domain (which we assume to mean it's // there is only one possible instance). - if (the_instance.fields.domain === undefined && network_info.domain === undefined) { + if ( + ( + the_instance.fields.domain === undefined && + network_info.domain === undefined + ) || + ( + the_instance.fields.domain !== undefined && + the_instance.fields.domain == network_info.domain + ) + ) { matched_instance = the_instance; } } else if (network_info.domain) {