sync_events: Fix RoomSummary serde attributes
* Create an empty heroes vector if the response doesn't contain it. The heroes map is strictly optional and as is deserialization might fail for the whole response unless we allow it to be optional. * Rename the room summary fields during (de)serialization.
This commit is contained in:
parent
09ac2404de
commit
3dfb500bba
@ -260,15 +260,17 @@ pub struct Ephemeral {
|
||||
pub struct RoomSummary {
|
||||
/// Users which can be used to generate a room name if the room does not have
|
||||
/// one. Required if room name or canonical aliases are not set or empty.
|
||||
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||
#[serde(rename = "m.heroes", default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub heroes: Vec<String>,
|
||||
/// Number of users whose membership status is `join`.
|
||||
/// Required if field has changed since last sync; otherwise, it may be
|
||||
/// omitted.
|
||||
#[serde(rename = "m.joined_member_count")]
|
||||
pub joined_member_count: Option<UInt>,
|
||||
/// Number of users whose membership status is `invite`.
|
||||
/// Required if field has changed since last sync; otherwise, it may be
|
||||
/// omitted.
|
||||
#[serde(rename = "m.invited_member_count")]
|
||||
pub invited_member_count: Option<UInt>,
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user