make Status.filtered nullable to make some weird api implementations work again

This commit is contained in:
Conny Duck 2024-05-06 19:00:42 +02:00
parent 05c7e7b806
commit 1948d55b61
No known key found for this signature in database
3 changed files with 3 additions and 3 deletions

View File

@ -107,7 +107,7 @@ fun Status.toEntity(
card = actionableStatus.card,
repliesCount = actionableStatus.repliesCount,
language = actionableStatus.language,
filtered = actionableStatus.filtered
filtered = actionableStatus.filtered.orEmpty()
)
fun TimelineStatusEntity.toStatus(

View File

@ -57,7 +57,7 @@ data class Status(
/** 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()
val filtered: List<FilterResult>? = null
) {
val actionableId: String

View File

@ -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)
}