Room preview on a long press should not update the read receipt (#6027)

- Done
This commit is contained in:
Gil Eluard
2022-04-14 10:30:51 +02:00
committed by GitHub
parent 7bc6bce163
commit 1a7cfb2223
9 changed files with 92 additions and 13 deletions
@@ -47,11 +47,18 @@ class RecentCellContextMenuProvider: NSObject {
}
roomViewController.isContextPreview = true
let roomDataSourceManager = MXKRoomDataSourceManager.sharedManager(forMatrixSession: session)
roomDataSourceManager?.roomDataSource(forRoom: room.roomId, create: true, onComplete: { roomDataSource in
roomViewController.displayRoom(roomDataSource)
})
RoomPreviewDataSource.load(withRoomId: room.roomId, andMatrixSession: session) { [weak roomViewController] roomDataSource in
guard let dataSource = roomDataSource as? RoomPreviewDataSource else {
return
}
dataSource.markTimelineInitialEvent = false
roomViewController?.displayRoom(dataSource)
// Give the data source ownership to the room view controller.
roomViewController?.hasRoomDataSourceOwnership = true
}
return roomViewController
} else {
let viewModel = RoomContextPreviewViewModel(room: room)