fix: Do not call fullRoom on all rooms.

`fullRoom` creates a `Timeline` for the room. Calling this method on all
rooms doesn't make the room list fast :-).

Needs https://github.com/matrix-org/matrix-rust-sdk/pull/2186 to be merged.
This commit is contained in:
Ivan Enderlin 2023-06-29 15:16:36 +02:00 committed by Stefan Ceriu
parent b2ab6103c3
commit b1dc20e55c

View File

@ -155,17 +155,15 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
lastMessageFormattedTimestamp = lastMessage.timestamp.formattedMinimal()
attributedLastMessage = eventStringBuilder.buildAttributedString(for: lastMessage)
}
let room = roomListItem.fullRoom()
let details = RoomSummaryDetails(id: roomListItem.id(),
name: roomListItem.name() ?? room.id(),
isDirect: room.isDirect(),
avatarURL: room.avatarUrl().flatMap(URL.init(string:)),
name: roomListItem.name() ?? roomListItem.id(),
isDirect: roomListItem.isDirect(),
avatarURL: roomListItem.avatarUrl().flatMap(URL.init(string:)),
lastMessage: attributedLastMessage,
lastMessageFormattedTimestamp: lastMessageFormattedTimestamp,
unreadNotificationCount: UInt(roomListItem.unreadNotifications().notificationCount()),
canonicalAlias: room.canonicalAlias())
canonicalAlias: roomListItem.canonicalAlias())
return invalidated ? .invalidated(details: details) : .filled(details: details)
}