From b1dc20e55cd4e97c00d10fd1bf469540c73e3856 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Thu, 29 Jun 2023 15:16:36 +0200 Subject: [PATCH] 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. --- .../Room/RoomSummary/RoomSummaryProvider.swift | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift index e78c765b0..5b2b96ae0 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift @@ -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) }