Make display_name of RoomMember optional

This commit is contained in:
iinuwa 2020-04-25 02:30:20 -05:00 committed by GitHub
parent 2e696a114b
commit 210e3fd4a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -24,6 +24,7 @@ Breaking changes:
* Change the messages type that gets sent out using the `r0::client_exchange::send_event_to_device`
request.
* Add `M_USER_DEACTIVATED` to `error::ErrorKind`
* Make `display_name` field of `r0::membership::joined_events::RoomMember` optional
Improvements:

View File

@ -1,4 +1,4 @@
//! [GET /_matrix/client/r0/rooms/{roomId}/joined_members](https://matrix.org/docs/spec/client_server/r0.4.0.html#get-matrix-client-r0-rooms-roomid-joined-members)
//! [GET /_matrix/client/r0/rooms/{roomId}/joined_members](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-rooms-roomid-joined-members)
use std::collections::BTreeMap;
@ -31,12 +31,13 @@ ruma_api! {
error: crate::Error
}
// TODO: Find out whether display_name and avatar_url are optional
/// Information about a room member.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct RoomMember {
/// The display name of the user.
pub display_name: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
/// The mxc avatar url of the user.
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar_url: Option<String>,
}