Skip to content

Commit d7504ae

Browse files
committed
Switch to new view_room
1 parent a030e46 commit d7504ae

1 file changed

Lines changed: 9 additions & 14 deletions

File tree

‎src/components/structures/RoomDirectory.js‎

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,16 @@ module.exports = React.createClass({
116116
};
117117
}
118118

119-
var payload = {
119+
// It's not really possible to join Matrix rooms by ID because the HS has no way to know
120+
// which servers to start querying. However, there's no other way to join rooms in
121+
// this list without aliases at present, so if roomAlias isn't set here we'll rely
122+
// on view_room falling back to using the ID
123+
dis.dispatch({
120124
oob_data: oob_data,
121-
};
122-
if (roomAlias) {
123-
payload.action = 'view_room_alias';
124-
payload.room_alias = roomAlias;
125-
} else {
126-
// It's not really possible to join Matrix rooms by ID because the HS has no way to know
127-
// which servers to start querying. However, there's no other way to join rooms in
128-
// this list without aliases at present.
129-
payload.action = 'view_room';
130-
payload.room_id = roomId;
131-
}
132-
133-
dis.dispatch(payload);
125+
action: 'view_room',
126+
room_id: roomId,
127+
room_alias: roomAlias,
128+
});
134129
},
135130

136131
getRows: function(filter) {

0 commit comments

Comments
 (0)