diff --git a/src/stores/RoomViewStore.js b/src/stores/RoomViewStore.js index 15a46894a1..929696896a 100644 --- a/src/stores/RoomViewStore.js +++ b/src/stores/RoomViewStore.js @@ -185,7 +185,9 @@ class RoomViewStore extends Store { this._setState({ joining: true, }); - MatrixClientPeg.get().joinRoom(this._state.roomId, payload.opts).done(() => { + MatrixClientPeg.get().joinRoom( + this._state.roomAlias || this._state.roomId, payload.opts, + ).done(() => { dis.dispatch({ action: 'joined_room', }); diff --git a/test/stores/RoomViewStore-test.js b/test/stores/RoomViewStore-test.js index 2f545ffd74..adcae90e9b 100644 --- a/test/stores/RoomViewStore-test.js +++ b/test/stores/RoomViewStore-test.js @@ -28,8 +28,8 @@ describe('RoomViewStore', function() { }); it('can be used to view a room by ID and join', function(done) { - peg.get().joinRoom = (roomId) => { - expect(roomId).toBe("!randomcharacters:aser.ver"); + peg.get().joinRoom = (roomAddress) => { + expect(roomAddress).toBe("!randomcharacters:aser.ver"); done(); }; @@ -40,8 +40,8 @@ describe('RoomViewStore', function() { it('can be used to view a room by alias and join', function(done) { peg.get().getRoomIdForAlias.returns(q({room_id: "!randomcharacters:aser.ver"})); - peg.get().joinRoom = (roomId) => { - expect(roomId).toBe("!randomcharacters:aser.ver"); + peg.get().joinRoom = (roomAddress) => { + expect(roomAddress).toBe("#somealias2:aser.ver"); done(); };