diff --git a/src/room/message.rs b/src/room/message.rs index e0bbcc15..487ff2f3 100644 --- a/src/room/message.rs +++ b/src/room/message.rs @@ -221,8 +221,9 @@ pub struct VideoInfo { #[serde(skip_serializing_if="Option::is_none")] pub duration: Option, /// The height of the video in pixels. + #[serde(rename = "h")] #[serde(skip_serializing_if="Option::is_none")] - pub h: Option, + pub height: Option, /// The mimetype of the video, e.g. "video/mp4." #[serde(skip_serializing_if="Option::is_none")] pub mimetype: Option, @@ -236,8 +237,9 @@ pub struct VideoInfo { #[serde(skip_serializing_if="Option::is_none")] pub thumbnail_url: Option, /// The width of the video in pixels. + #[serde(rename = "w")] #[serde(skip_serializing_if="Option::is_none")] - pub w: Option, + pub width: Option, } impl_enum! { diff --git a/src/room/mod.rs b/src/room/mod.rs index b4f73d11..232f7556 100644 --- a/src/room/mod.rs +++ b/src/room/mod.rs @@ -21,11 +21,13 @@ pub mod topic; #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)] pub struct ImageInfo { /// The height of the image in pixels. - pub h: u64, + #[serde(rename = "h")] + pub height: u64, /// The MIME type of the image, e.g. "image/png." pub mimetype: String, /// The file size of the image in bytes. pub size: u64, /// The width of the image in pixels. - pub w: u64, + #[serde(rename = "w")] + pub width: u64, } diff --git a/src/stripped.rs b/src/stripped.rs index a760e456..28d50500 100644 --- a/src/stripped.rs +++ b/src/stripped.rs @@ -333,8 +333,8 @@ mod tests { StrippedState::RoomAvatar(event) => { let image_info = event.content.info.unwrap(); - assert_eq!(image_info.h, 128); - assert_eq!(image_info.w, 128); + assert_eq!(image_info.height, 128); + assert_eq!(image_info.width, 128); assert_eq!(image_info.mimetype, "image/jpeg"); assert_eq!(image_info.size, 1024); assert_eq!(event.content.thumbnail_info.unwrap().size, 32);