From d7504aeda5b6d802417e4b5362e5c51af149b9f0 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 10 Jun 2016 15:13:41 +0100 Subject: [PATCH] Switch to new view_room --- src/components/structures/RoomDirectory.js | 23 +++++++++------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index 1f1d4a8cb2..2a37616b6a 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -116,21 +116,16 @@ module.exports = React.createClass({ }; } - var payload = { + // 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({ oob_data: oob_data, - }; - if (roomAlias) { - payload.action = 'view_room_alias'; - payload.room_alias = roomAlias; - } else { - // 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. - payload.action = 'view_room'; - payload.room_id = roomId; - } - - dis.dispatch(payload); + action: 'view_room', + room_id: roomId, + room_alias: roomAlias, + }); }, getRows: function(filter) {