#93: Add a sync limit of 20 and prefill rooms when loading the last message.

Update the SDK to 1.0.13-alpha.
This commit is contained in:
Doug
2022-07-28 12:46:48 +01:00
committed by GitHub
parent c20bc6bd1c
commit 87b2a41a69
8 changed files with 16 additions and 7 deletions
@@ -67,6 +67,10 @@ class RoomProxy: RoomProxyProtocol {
room.topic()
}
var isJoined: Bool {
room.membership() == .joined
}
var isDirect: Bool {
room.isDirect()
}
@@ -141,7 +141,8 @@ class RoomSummary: RoomSummaryProtocol {
return
}
switch await roomProxy.paginateBackwards(count: 1) {
// Pre-fill the room with some messages and use the last message in the response.
switch await roomProxy.paginateBackwards(count: UInt(ClientProxy.syncLimit)) {
case .success:
lastMessage = await eventBriefFactory.buildEventBriefFor(message: roomProxy.messages.last)
case .failure(let error):