Revert "RoomSummaryController: Remove deprecated usage of ScSdkPreferences"

This reverts commit 777f349f82.
This commit is contained in:
SpiritCroc 2020-09-22 09:56:04 +02:00
parent 9425640277
commit 4ef447d739

View file

@ -23,6 +23,7 @@ import im.vector.app.core.epoxy.helpFooterItem
import im.vector.app.core.resources.StringProvider import im.vector.app.core.resources.StringProvider
import im.vector.app.core.resources.UserPreferencesProvider import im.vector.app.core.resources.UserPreferencesProvider
import im.vector.app.features.home.RoomListDisplayMode import im.vector.app.features.home.RoomListDisplayMode
import im.vector.app.features.home.room.ScSdkPreferences
import im.vector.app.features.home.room.filtered.FilteredRoomFooterItem import im.vector.app.features.home.room.filtered.FilteredRoomFooterItem
import im.vector.app.features.home.room.filtered.filteredRoomFooterItem import im.vector.app.features.home.room.filtered.filteredRoomFooterItem
import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState
@ -34,7 +35,8 @@ import javax.inject.Inject
class RoomSummaryController @Inject constructor(private val stringProvider: StringProvider, class RoomSummaryController @Inject constructor(private val stringProvider: StringProvider,
private val roomSummaryItemFactory: RoomSummaryItemFactory, private val roomSummaryItemFactory: RoomSummaryItemFactory,
private val roomListNameFilter: RoomListNameFilter, private val roomListNameFilter: RoomListNameFilter,
private val userPreferencesProvider: UserPreferencesProvider private val userPreferencesProvider: UserPreferencesProvider,
private val scSdkPreferences: ScSdkPreferences
) : EpoxyController() { ) : EpoxyController() {
var listener: Listener? = null var listener: Listener? = null
@ -139,7 +141,7 @@ class RoomSummaryController @Inject constructor(private val stringProvider: Stri
0 0
} else { } else {
// TODO actual sum of events instead of sum of chats? // TODO actual sum of events instead of sum of chats?
summaries.map { it.hasUnreadMessages }.sumBy { b -> if (b) 1 else 0 } summaries.map { it.scHasUnreadMessages(scSdkPreferences) }.sumBy { b -> if (b) 1 else 0 }
} }
val showHighlighted = summaries.any { it.highlightCount > 0 } val showHighlighted = summaries.any { it.highlightCount > 0 }
roomCategoryItem { roomCategoryItem {