Skip to content

Commit 3547bd8

Browse files
committed
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.
1 parent a5986ad commit 3547bd8

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

‎src/components/structures/RoomDirectory.js‎

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

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({
119+
var payload = {
124120
oob_data: oob_data,
125121
action: 'view_room',
126-
room_id: roomId,
127-
room_alias: roomAlias,
128-
});
122+
};
123+
// It's not really possible to join Matrix rooms by ID because the HS has no way to know
124+
// which servers to start querying. However, there's no other way to join rooms in
125+
// this list without aliases at present, so if roomAlias isn't set here we have no
126+
// choice but to supply the ID.
127+
if (roomAlias) {
128+
payload.room_alias = roomAlias;
129+
} else {
130+
payload.room_id = roomId;
131+
}
132+
dis.dispatch(payload);
129133
},
130134

131135
getRows: function(filter) {

0 commit comments

Comments
 (0)