Revert "Fix sorting rooms when filtering out events from overview"
This reverts commit 4d3229a321
.
This commit is contained in:
parent
e6cf19fe94
commit
80c2490336
|
@ -16,19 +16,18 @@
|
||||||
|
|
||||||
package im.vector.app.features.home.room.list
|
package im.vector.app.features.home.room.list
|
||||||
|
|
||||||
import im.vector.app.features.home.room.ScSdkPreferences
|
|
||||||
import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class ChronologicalRoomComparator @Inject constructor(val scSdkPreferences: ScSdkPreferences) : Comparator<RoomSummary> {
|
class ChronologicalRoomComparator @Inject constructor() : Comparator<RoomSummary> {
|
||||||
|
|
||||||
override fun compare(leftRoomSummary: RoomSummary?, rightRoomSummary: RoomSummary?): Int {
|
override fun compare(leftRoomSummary: RoomSummary?, rightRoomSummary: RoomSummary?): Int {
|
||||||
return when {
|
return when {
|
||||||
rightRoomSummary?.scLatestPreviewableEvent(scSdkPreferences)?.root == null -> -1
|
rightRoomSummary?.latestPreviewableEvent?.root == null -> -1
|
||||||
leftRoomSummary?.scLatestPreviewableEvent(scSdkPreferences)?.root == null -> 1
|
leftRoomSummary?.latestPreviewableEvent?.root == null -> 1
|
||||||
else -> {
|
else -> {
|
||||||
val rightTimestamp = rightRoomSummary.scLatestPreviewableEvent(scSdkPreferences)?.root?.originServerTs ?: 0
|
val rightTimestamp = rightRoomSummary.latestPreviewableEvent?.root?.originServerTs ?: 0
|
||||||
val leftTimestamp = leftRoomSummary.scLatestPreviewableEvent(scSdkPreferences)?.root?.originServerTs ?: 0
|
val leftTimestamp = leftRoomSummary.latestPreviewableEvent?.root?.originServerTs ?: 0
|
||||||
|
|
||||||
val deltaTimestamp = rightTimestamp - leftTimestamp
|
val deltaTimestamp = rightTimestamp - leftTimestamp
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue