Browse Source

make Status.filtered nullable to make some weird api implementations work again (#4426)

closes https://github.com/tuskyapp/Tusky/issues/4424
pull/4420/head
Konrad Pozniak 2 years ago committed by Conny Duck
parent
commit
ba575dbfc6
No known key found for this signature in database
  1. 5
      app/src/main/java/com/keylesspalace/tusky/entity/Status.kt
  2. 2
      app/src/main/java/com/keylesspalace/tusky/network/FilterModel.kt

5
app/src/main/java/com/keylesspalace/tusky/entity/Status.kt

@ -56,8 +56,9 @@ data class Status(
val card: Card? = null,
/** ISO 639 language code for this status. */
val language: String? = null,
/** If the current token has an authorized user: The filter and keywords that matched this status. */
val filtered: List<FilterResult> = emptyList()
/** If the current token has an authorized user: The filter and keywords that matched this status.
* Iceshrimp and maybe other implementations explicitly send filtered=null so we can't default to empty list. */
val filtered: List<FilterResult>? = null
) {
val actionableId: String

2
app/src/main/java/com/keylesspalace/tusky/network/FilterModel.kt

@ -47,7 +47,7 @@ class FilterModel @Inject constructor() {
}
}
val matchingKind = status.filtered.filter { result ->
val matchingKind = status.filtered.orEmpty().filter { result ->
result.filter.kinds.contains(kind)
}

Loading…
Cancel
Save