New SlidingSync flow (#373)

* Switch back to using slidingSync rooms for timeline listeners

* Expose 2 types of slidingSync views from the clientProxy and combine their results for the roomList

* Fix breaking api changes

* Remove sender mxids from the room list (until rust provides resolved display names)

* Bump RustSDK to v1.0.22-alpha

* Rename originServerTs to timestamp throughout

* Simplified sliding sync view list merging

* Rollback some SS changes as things still don't work properly

* Revert "Switch back to using slidingSync rooms for timeline listeners"

This reverts commit 1d6a6c09d8ddf386edefbe0ac6beaf52cc333fba.
This commit is contained in:
Stefan Ceriu
2022-12-16 14:05:08 +02:00
committed by GitHub
parent 6f974a4422
commit ab10278ff5
13 changed files with 119 additions and 76 deletions
@@ -63,9 +63,9 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
func updateRoomsWithIdentifiers(_ identifiers: [String]) {
#warning("This is a valid check but Rust doesn't set it correctly for selective ranged syncs")
// guard statePublisher.value == .live else {
// return
// }
// guard statePublisher.value == .live else {
// return
// }
var changes = [CollectionDifference<RoomSummary>.Change]()
for identifier in identifiers {
@@ -136,11 +136,14 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
var lastMessageTimestamp: Date?
if let latestRoomMessage = room.latestRoomMessage() {
let lastMessage = roomMessageFactory.buildRoomMessageFrom(EventTimelineItemProxy(item: latestRoomMessage))
if let lastMessageSender = try? AttributedString(markdown: "**\(lastMessage.sender)**") {
// Don't include the message body in the markdown otherwise it makes tappable links.
attributedLastMessage = lastMessageSender + ": " + AttributedString(lastMessage.body)
}
lastMessageTimestamp = lastMessage.originServerTs
#warning("Intentionally remove the sender mxid from the room list for now")
// if let lastMessageSender = try? AttributedString(markdown: "**\(lastMessage.sender)**") {
// // Don't include the message body in the markdown otherwise it makes tappable links.
// attributedLastMessage = lastMessageSender + ": " + AttributedString(lastMessage.body)
// }
attributedLastMessage = AttributedString(lastMessage.body)
lastMessageTimestamp = lastMessage.timestamp
}
return .filled(details: RoomSummaryDetails(id: room.roomId(),