mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Switch entirely to dynamic room list entries (normalizedMatchRoomName brings the same behavior as the old implementation) and cleanup
This commit is contained in:
committed by
Stefan Ceriu
parent
8dca82e65e
commit
269fd3d1f6
@@ -78,36 +78,16 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
}
|
||||
|
||||
self.roomList = roomList
|
||||
|
||||
|
||||
do {
|
||||
if appSettings.dynamicEntriesEnabled {
|
||||
listUpdatesSubscriptionResult = roomList.entriesWithDynamicFilter(listener: RoomListEntriesListenerProxy { [weak self] updates in
|
||||
guard let self else { return }
|
||||
MXLog.info("\(name): Received list update")
|
||||
diffsPublisher.send(updates)
|
||||
})
|
||||
|
||||
listUpdatesTaskHandle = listUpdatesSubscriptionResult?.entriesStream
|
||||
|
||||
// Forces the listener above to be called with the current state
|
||||
updateFilterPattern(nil)
|
||||
} else {
|
||||
let listUpdatesSubscriptionResult = roomList.entries(listener: RoomListEntriesListenerProxy { [weak self] updates in
|
||||
guard let self else { return }
|
||||
MXLog.info("\(name): Received list update")
|
||||
diffsPublisher.send(updates)
|
||||
})
|
||||
|
||||
listUpdatesTaskHandle = listUpdatesSubscriptionResult.entriesStream
|
||||
|
||||
rooms = listUpdatesSubscriptionResult.entries.map { roomListEntry in
|
||||
buildSummaryForRoomListEntry(roomListEntry)
|
||||
}
|
||||
|
||||
// Manually call it here as the didSet doesn't work from constructors
|
||||
roomListSubject.send(rooms)
|
||||
}
|
||||
|
||||
listUpdatesSubscriptionResult = roomList.entriesWithDynamicFilter(listener: RoomListEntriesListenerProxy { [weak self] updates in
|
||||
guard let self else { return }
|
||||
MXLog.info("\(name): Received list update")
|
||||
diffsPublisher.send(updates)
|
||||
})
|
||||
|
||||
listUpdatesTaskHandle = listUpdatesSubscriptionResult?.entriesStream
|
||||
|
||||
let stateUpdatesSubscriptionResult = try roomList.loadingState(listener: RoomListStateObserver { [weak self] state in
|
||||
guard let self else { return }
|
||||
MXLog.info("\(name): Received state update: \(state)")
|
||||
@@ -139,8 +119,6 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
return
|
||||
}
|
||||
|
||||
guard appSettings.dynamicEntriesEnabled else { return }
|
||||
|
||||
_ = listUpdatesSubscriptionResult?.dynamicFilter.set(kind: .normalizedMatchRoomName(pattern: pattern.lowercased()))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user