Browse Source

Use new API `awaitRoomRemoteEcho` to wait for the created room to be available.

pull/3472/head
Benoit Marty 1 month ago
parent
commit
beb0bff3cc
  1. 8
      libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt

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

@ -311,14 +311,16 @@ class RustMatrixClient(
avatar = createRoomParams.avatar, avatar = createRoomParams.avatar,
powerLevelContentOverride = defaultRoomCreationPowerLevels, powerLevelContentOverride = defaultRoomCreationPowerLevels,
) )
val roomId = RoomId(client.createRoom(rustParams)) val roomId = client.createRoom(rustParams)
// Wait to receive the room back from the sync but do not returns failure if it fails. // Wait to receive the room back from the sync but do not returns failure if it fails.
try { try {
awaitJoinedRoom(roomId.toRoomIdOrAlias(), 30.seconds) withTimeout(30.seconds) {
client.awaitRoomRemoteEcho(roomId)
}
} catch (e: Exception) { } catch (e: Exception) {
Timber.e(e, "Timeout waiting for the room to be available in the room list") Timber.e(e, "Timeout waiting for the room to be available in the room list")
} }
roomId RoomId(roomId)
} }
} }

Loading…
Cancel
Save