From 3547bd8d00cef7a202b38cf8158d7dcc9005c0f1 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 14 Jun 2016 13:02:34 +0100 Subject: [PATCH] Update for react-sdk dbkr/fix_peeking branch With the react-sdk update, this does nothing functionally since the room ID would just have been ignored, but update this to correctly supply only one of ID/alias. --- src/components/structures/RoomDirectory.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index 2a37616b6a..cc16e3c6e6 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -116,16 +116,20 @@ module.exports = React.createClass({ }; } - // It's not really possible to join Matrix rooms by ID because the HS has no way to know - // which servers to start querying. However, there's no other way to join rooms in - // this list without aliases at present, so if roomAlias isn't set here we'll rely - // on view_room falling back to using the ID - dis.dispatch({ + var payload = { oob_data: oob_data, action: 'view_room', - room_id: roomId, - room_alias: roomAlias, - }); + }; + // It's not really possible to join Matrix rooms by ID because the HS has no way to know + // which servers to start querying. However, there's no other way to join rooms in + // this list without aliases at present, so if roomAlias isn't set here we have no + // choice but to supply the ID. + if (roomAlias) { + payload.room_alias = roomAlias; + } else { + payload.room_id = roomId; + } + dis.dispatch(payload); }, getRows: function(filter) {