events: Add unstable support for is_animated image flag

According to MSC4230.
This commit is contained in:
Kévin Commaille 2024-12-28 15:50:28 +01:00 committed by strawberry
parent 6441d823dd
commit 0a37df11cd
4 changed files with 16 additions and 0 deletions

View File

@ -12,6 +12,10 @@
event.
- `make_replacement` does not take the replied-to message anymore.
Improvements:
- Add unstable support for the `is_animated` flag for images, according to MSC4230.
# 0.30.0
Breaking changes:

View File

@ -44,6 +44,7 @@ unstable-msc3956 = ["unstable-msc1767"]
unstable-msc4075 = ["unstable-msc3401"]
unstable-msc4095 = []
unstable-msc4171 = []
unstable-msc4230 = []
unstable-pdu = []
# Allow some mandatory fields to be missing, defaulting them to an empty string

View File

@ -105,6 +105,15 @@ pub struct ImageInfo {
#[cfg(feature = "unstable-msc2448")]
#[serde(rename = "xyz.amorgan.blurhash", skip_serializing_if = "Option::is_none")]
pub blurhash: Option<String>,
/// Whether the image is animated.
///
/// This uses the unstable prefix in [MSC4230].
///
/// [MSC4230]: https://github.com/matrix-org/matrix-spec-proposals/pull/4230
#[cfg(feature = "unstable-msc4230")]
#[serde(rename = "org.matrix.msc4230.is_animated", skip_serializing_if = "Option::is_none")]
pub is_animated: Option<bool>,
}
impl ImageInfo {

View File

@ -270,6 +270,7 @@ unstable-msc4140 = ["ruma-client-api?/unstable-msc4140"]
unstable-msc4171 = ["ruma-events?/unstable-msc4171"]
unstable-msc4186 = ["ruma-client-api?/unstable-msc4186"]
unstable-msc4210 = ["ruma-common/unstable-msc4210"]
unstable-msc4230 = ["ruma-events?/unstable-msc4230"]
unstable-pdu = ["ruma-events?/unstable-pdu"]
unstable-unspecified = [
"ruma-common/unstable-unspecified",
@ -322,6 +323,7 @@ __unstable-mscs = [
"unstable-msc4140",
"unstable-msc4171",
"unstable-msc4186",
"unstable-msc4230",
]
__ci = [
"full",