fix: Tolerate missing status fields on veganism.social (#911)
veganism.social is doing something weird that injects statuses into the user's timeline that are missing the fields that are normally present on authenticated statuses. So far I've noticed: - `reblogged` - `favourited` - `bookmarked` on the top level `Status` are missing, and if the status contains a poll the `voted` field is also missing. Cover up this breakage by setting defaults for these fields.
This commit is contained in:
parent
b81b55cb56
commit
344ba62368
|
@ -16,7 +16,7 @@ data class Poll(
|
|||
val options: List<PollOption>,
|
||||
// Friendica can incorrectly return null for `voted`. Default to false.
|
||||
// https://github.com/friendica/friendica/issues/13922
|
||||
@BooleanIfNull(false) val voted: Boolean,
|
||||
@BooleanIfNull(false) val voted: Boolean = false,
|
||||
@Json(name = "own_votes") val ownVotes: List<Int>?,
|
||||
) {
|
||||
|
||||
|
|
|
@ -43,9 +43,9 @@ data class Status(
|
|||
@Json(name = "reblogs_count") val reblogsCount: Int,
|
||||
@Json(name = "favourites_count") val favouritesCount: Int,
|
||||
@Json(name = "replies_count") val repliesCount: Int,
|
||||
val reblogged: Boolean,
|
||||
val favourited: Boolean,
|
||||
val bookmarked: Boolean,
|
||||
val reblogged: Boolean = false,
|
||||
val favourited: Boolean = false,
|
||||
val bookmarked: Boolean = false,
|
||||
val sensitive: Boolean,
|
||||
@Json(name = "spoiler_text") val spoilerText: String,
|
||||
val visibility: Visibility,
|
||||
|
|
Loading…
Reference in New Issue