Skip to content

Commit beb0bff

Browse files
committed
Use new API awaitRoomRemoteEcho to wait for the created room to be available.
1 parent 62a9d8c commit beb0bff

File tree

1 file changed

+5
-3
lines changed
  • libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl

1 file changed

+5
-3
lines changed

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,14 +311,16 @@ class RustMatrixClient(
311311
avatar = createRoomParams.avatar,
312312
powerLevelContentOverride = defaultRoomCreationPowerLevels,
313313
)
314-
val roomId = RoomId(client.createRoom(rustParams))
314+
val roomId = client.createRoom(rustParams)
315315
// Wait to receive the room back from the sync but do not returns failure if it fails.
316316
try {
317-
awaitJoinedRoom(roomId.toRoomIdOrAlias(), 30.seconds)
317+
withTimeout(30.seconds) {
318+
client.awaitRoomRemoteEcho(roomId)
319+
}
318320
} catch (e: Exception) {
319321
Timber.e(e, "Timeout waiting for the room to be available in the room list")
320322
}
321-
roomId
323+
RoomId(roomId)
322324
}
323325
}
324326

0 commit comments

Comments
 (0)