mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Use new API awaitRoomRemoteEcho to ensure that the room is ready SDK side.
This commit is contained in:
+5
-5
@@ -272,6 +272,8 @@ class RustMatrixClient(
|
|||||||
.filter(predicate)
|
.filter(predicate)
|
||||||
.first()
|
.first()
|
||||||
.first()
|
.first()
|
||||||
|
// Ensure that the room is ready
|
||||||
|
.also { client.awaitRoomRemoteEcho(it.roomId.value) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,16 +313,14 @@ class RustMatrixClient(
|
|||||||
avatar = createRoomParams.avatar,
|
avatar = createRoomParams.avatar,
|
||||||
powerLevelContentOverride = defaultRoomCreationPowerLevels,
|
powerLevelContentOverride = defaultRoomCreationPowerLevels,
|
||||||
)
|
)
|
||||||
val roomId = client.createRoom(rustParams)
|
val roomId = 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 {
|
||||||
withTimeout(30.seconds) {
|
awaitJoinedRoom(roomId.toRoomIdOrAlias(), 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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user