mirror of https://github.com/vector-im/riot-web
Merge pull request #1062 from matrix-org/luke/fix-rvs-join-by-alias
When joining, use a roomAlias if we have itpull/21833/head
commit
091d8d3d36
|
@ -185,7 +185,9 @@ class RoomViewStore extends Store {
|
||||||
this._setState({
|
this._setState({
|
||||||
joining: true,
|
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({
|
dis.dispatch({
|
||||||
action: 'joined_room',
|
action: 'joined_room',
|
||||||
});
|
});
|
||||||
|
|
|
@ -28,8 +28,8 @@ describe('RoomViewStore', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can be used to view a room by ID and join', function(done) {
|
it('can be used to view a room by ID and join', function(done) {
|
||||||
peg.get().joinRoom = (roomId) => {
|
peg.get().joinRoom = (roomAddress) => {
|
||||||
expect(roomId).toBe("!randomcharacters:aser.ver");
|
expect(roomAddress).toBe("!randomcharacters:aser.ver");
|
||||||
done();
|
done();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -40,8 +40,8 @@ describe('RoomViewStore', function() {
|
||||||
|
|
||||||
it('can be used to view a room by alias and join', function(done) {
|
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().getRoomIdForAlias.returns(q({room_id: "!randomcharacters:aser.ver"}));
|
||||||
peg.get().joinRoom = (roomId) => {
|
peg.get().joinRoom = (roomAddress) => {
|
||||||
expect(roomId).toBe("!randomcharacters:aser.ver");
|
expect(roomAddress).toBe("#somealias2:aser.ver");
|
||||||
done();
|
done();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue