RoomSummaryController: Remove deprecated usage of ScSdkPreferences

Change-Id: I3ef6148e6162b2836c335234df17fb26c9978e5f
This commit is contained in:
SpiritCroc 2020-09-17 12:22:49 +02:00
parent 80c2490336
commit 777f349f82
1 changed files with 2 additions and 4 deletions

View File

@ -23,7 +23,6 @@ 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
@ -35,8 +34,7 @@ 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
@ -141,7 +139,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.scHasUnreadMessages(scSdkPreferences) }.sumBy { b -> if (b) 1 else 0 } summaries.map { it.hasUnreadMessages }.sumBy { b -> if (b) 1 else 0 }
} }
val showHighlighted = summaries.any { it.highlightCount > 0 } val showHighlighted = summaries.any { it.highlightCount > 0 }
roomCategoryItem { roomCategoryItem {