fix: Load announcements with associated statuses correctly (#987)

The `Status` type associated with an announcement is entirely different
to the regular `Status` type, with a different JSON shape. The incorrect
type meant a deserialisation error when loading announcements with
associated statuses.
This commit is contained in:
Nik Clayton 2024-10-08 14:44:19 +02:00 committed by GitHub
parent 59a0e3087c
commit 1c5699e282
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -31,7 +31,7 @@ data class Announcement(
@Json(name = "updated_at") val updatedAt: Date, @Json(name = "updated_at") val updatedAt: Date,
val read: Boolean, val read: Boolean,
val mentions: List<Status.Mention>, val mentions: List<Status.Mention>,
val statuses: List<Status>, val statuses: List<AnnouncementStatus>,
val tags: List<HashTag>, val tags: List<HashTag>,
val emojis: List<Emoji>, val emojis: List<Emoji>,
val reactions: List<Reaction>, val reactions: List<Reaction>,
@ -57,4 +57,10 @@ data class Announcement(
val url: String?, val url: String?,
@Json(name = "static_url") val staticUrl: String?, @Json(name = "static_url") val staticUrl: String?,
) )
@JsonClass(generateAdapter = true)
data class AnnouncementStatus(
val id: String,
val url: String,
)
} }