dont skip serialising default values for capabilities

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-03-18 23:04:43 -04:00
parent d5d2698da3
commit 5ab81eef0a

View File

@ -23,44 +23,24 @@ pub mod v3;
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
pub struct Capabilities { pub struct Capabilities {
/// Capability to indicate if the user can change their password. /// Capability to indicate if the user can change their password.
#[serde( #[serde(rename = "m.change_password", default)]
rename = "m.change_password",
default,
skip_serializing_if = "ChangePasswordCapability::is_default"
)]
pub change_password: ChangePasswordCapability, pub change_password: ChangePasswordCapability,
/// The room versions the server supports. /// The room versions the server supports.
#[serde( #[serde(rename = "m.room_versions", default)]
rename = "m.room_versions",
default,
skip_serializing_if = "RoomVersionsCapability::is_default"
)]
pub room_versions: RoomVersionsCapability, pub room_versions: RoomVersionsCapability,
/// Capability to indicate if the user can change their display name. /// Capability to indicate if the user can change their display name.
#[serde( #[serde(rename = "m.set_displayname", default)]
rename = "m.set_displayname",
default,
skip_serializing_if = "SetDisplayNameCapability::is_default"
)]
pub set_displayname: SetDisplayNameCapability, pub set_displayname: SetDisplayNameCapability,
/// Capability to indicate if the user can change their avatar. /// Capability to indicate if the user can change their avatar.
#[serde( #[serde(rename = "m.set_avatar_url", default)]
rename = "m.set_avatar_url",
default,
skip_serializing_if = "SetAvatarUrlCapability::is_default"
)]
pub set_avatar_url: SetAvatarUrlCapability, pub set_avatar_url: SetAvatarUrlCapability,
/// Capability to indicate if the user can change the third-party identifiers associated with /// Capability to indicate if the user can change the third-party identifiers associated with
/// their account. /// their account.
#[serde( #[serde(rename = "m.3pid_changes", default)]
rename = "m.3pid_changes",
default,
skip_serializing_if = "ThirdPartyIdChangesCapability::is_default"
)]
pub thirdparty_id_changes: ThirdPartyIdChangesCapability, pub thirdparty_id_changes: ThirdPartyIdChangesCapability,
/// Any other custom capabilities that the server supports outside of the specification, /// Any other custom capabilities that the server supports outside of the specification,