From cfbe6c753adc1affceabd4d795ce9753d1c95e7b Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Mon, 28 Dec 2020 16:25:19 +0100 Subject: [PATCH] Refactor misleading "default" This used to be the default, but was changed upstream to default to something similar to our UNREAD_KIND_CONTENT. Change-Id: Id0e46eebcd3505071f200cafd603fb9828c9a919 --- .../matrix/android/sdk/api/session/room/model/RoomSummary.kt | 4 ++-- .../java/im/vector/app/features/home/room/ScSdkPreferences.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomSummary.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomSummary.kt index 6b900e6371..6a307731f8 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomSummary.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomSummary.kt @@ -91,7 +91,7 @@ data class RoomSummary constructor( return when(preferenceProvider.getUnreadKind(isDirect)) { UNREAD_KIND_ORIGINAL_CONTENT -> hasUnreadOriginalContentMessages UNREAD_KIND_CONTENT -> hasUnreadContentMessages - // UNREAD_KIND_DEFAULT + // UNREAD_KIND_FULL else -> hasUnreadMessages } } @@ -112,7 +112,7 @@ data class RoomSummary constructor( companion object { const val NOT_IN_BREADCRUMBS = -1 // SC addition - const val UNREAD_KIND_DEFAULT = 0 + const val UNREAD_KIND_FULL = 0 const val UNREAD_KIND_CONTENT = 1 const val UNREAD_KIND_ORIGINAL_CONTENT = 2 } diff --git a/vector/src/main/java/im/vector/app/features/home/room/ScSdkPreferences.kt b/vector/src/main/java/im/vector/app/features/home/room/ScSdkPreferences.kt index 939d502ea3..21341b8e37 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/ScSdkPreferences.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/ScSdkPreferences.kt @@ -10,6 +10,6 @@ class ScSdkPreferences @Inject constructor(private val vectorPreferences: Vector constructor(context: Context?) : this(vectorPreferences = context?.let { VectorPreferences(it) }) override fun getUnreadKind(isDirect: Boolean): Int { - return vectorPreferences?.roomUnreadKind(isDirect) ?: RoomSummary.UNREAD_KIND_DEFAULT + return vectorPreferences?.roomUnreadKind(isDirect) ?: RoomSummary.UNREAD_KIND_FULL } }