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:
parent
59a0e3087c
commit
1c5699e282
|
@ -31,7 +31,7 @@ data class Announcement(
|
|||
@Json(name = "updated_at") val updatedAt: Date,
|
||||
val read: Boolean,
|
||||
val mentions: List<Status.Mention>,
|
||||
val statuses: List<Status>,
|
||||
val statuses: List<AnnouncementStatus>,
|
||||
val tags: List<HashTag>,
|
||||
val emojis: List<Emoji>,
|
||||
val reactions: List<Reaction>,
|
||||
|
@ -57,4 +57,10 @@ data class Announcement(
|
|||
val url: String?,
|
||||
@Json(name = "static_url") val staticUrl: String?,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class AnnouncementStatus(
|
||||
val id: String,
|
||||
val url: String,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue