Update serde attr, add comment

This commit is contained in:
Jonas Platte 2020-04-30 18:19:35 +02:00
parent 0d305d8f24
commit c00a8cc52e
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
2 changed files with 3 additions and 4 deletions

View File

@ -17,22 +17,19 @@ ruma_event! {
/// The rule used for users wishing to join this room. /// The rule used for users wishing to join this room.
#[derive(Clone, Copy, Debug, PartialEq, Deserialize, Serialize)] #[derive(Clone, Copy, Debug, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum JoinRule { pub enum JoinRule {
/// A user who wishes to join the room must first receive an invite to the room from someone /// A user who wishes to join the room must first receive an invite to the room from someone
/// already inside of the room. /// already inside of the room.
#[serde(rename = "invite")]
Invite, Invite,
/// Reserved but not yet implemented by the Matrix specification. /// Reserved but not yet implemented by the Matrix specification.
#[serde(rename = "knock")]
Knock, Knock,
/// Reserved but not yet implemented by the Matrix specification. /// Reserved but not yet implemented by the Matrix specification.
#[serde(rename = "private")]
Private, Private,
/// Anyone can join the room without any prior action. /// Anyone can join the room without any prior action.
#[serde(rename = "public")]
Public, Public,
/// Additional variants may be added in the future and will not be considered breaking changes /// Additional variants may be added in the future and will not be considered breaking changes

View File

@ -56,6 +56,8 @@ ruma_event! {
/// contain information about that invitation. /// contain information about that invitation.
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub third_party_invite: Option<ThirdPartyInvite>, pub third_party_invite: Option<ThirdPartyInvite>,
// FIXME: spec says there is an unsigned field in content, which seems like an error.
}, },
} }
} }