Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 08e0f15

Browse files
authored
Merge pull request #5936 from matrix-org/t3chguy/fix/17084
Fix joining room using via servers regression
2 parents c6c56e0 + 27731ac commit 08e0f15

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/stores/RoomViewStore.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ const INITIAL_STATE = {
6060
replyingToEvent: null,
6161

6262
shouldPeek: false,
63+
64+
viaServers: [],
6365
};
6466

6567
/**
@@ -113,6 +115,7 @@ class RoomViewStore extends Store<ActionPayload> {
113115
this.setState({
114116
roomId: null,
115117
roomAlias: null,
118+
viaServers: [],
116119
});
117120
break;
118121
case 'view_room_error':
@@ -191,6 +194,7 @@ class RoomViewStore extends Store<ActionPayload> {
191194
replyingToEvent: null,
192195
// pull the user out of Room Settings
193196
isEditingSettings: false,
197+
viaServers: payload.via_servers,
194198
};
195199

196200
// Allow being given an event to be replied to when switching rooms but sanity check its for this room
@@ -226,6 +230,7 @@ class RoomViewStore extends Store<ActionPayload> {
226230
roomAlias: payload.room_alias,
227231
roomLoading: true,
228232
roomLoadError: null,
233+
viaServers: payload.via_servers,
229234
});
230235
try {
231236
const result = await MatrixClientPeg.get().getRoomIdForAlias(payload.room_alias);
@@ -261,6 +266,7 @@ class RoomViewStore extends Store<ActionPayload> {
261266
roomAlias: payload.room_alias,
262267
roomLoading: false,
263268
roomLoadError: payload.err,
269+
viaServers: [],
264270
});
265271
}
266272

@@ -272,9 +278,10 @@ class RoomViewStore extends Store<ActionPayload> {
272278

273279
const cli = MatrixClientPeg.get();
274280
const address = this.state.roomAlias || this.state.roomId;
281+
const viaServers = this.state.viaServers || [];
275282
try {
276283
await retry<void, MatrixError>(() => cli.joinRoom(address, {
277-
viaServers: payload.via_servers,
284+
viaServers,
278285
...payload.opts,
279286
}), NUM_JOIN_RETRY, (err) => {
280287
// if we received a Gateway timeout then retry

0 commit comments

Comments
 (0)