client-api: Deserialize stable names for unstable features
This commit is contained in:
parent
d8617d4dcb
commit
5c2c13145d
@ -30,7 +30,7 @@ ruma_api! {
|
||||
|
||||
/// Information about the tile server to use to display location data.
|
||||
#[cfg(feature = "unstable-msc3488")]
|
||||
#[serde(rename = "org.matrix.msc3488.tile_server")]
|
||||
#[serde(rename = "org.matrix.msc3488.tile_server", alias = "m.tile_server")]
|
||||
pub tile_server: Option<TileServerInfo>,
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ pub enum RelationType {
|
||||
Replacement,
|
||||
|
||||
/// `m.thread`, a participant to a thread.
|
||||
#[ruma_enum(rename = "io.element.thread")]
|
||||
#[ruma_enum(rename = "io.element.thread", alias = "m.thread")]
|
||||
Thread,
|
||||
|
||||
#[doc(hidden)]
|
||||
@ -153,6 +153,7 @@ pub struct RoomEventFilter<'a> {
|
||||
#[cfg(feature = "unstable-msc3440")]
|
||||
#[serde(
|
||||
rename = "io.element.relation_types",
|
||||
alias = "related_by_rel_types",
|
||||
default,
|
||||
skip_serializing_if = "<[_]>::is_empty"
|
||||
)]
|
||||
@ -165,6 +166,7 @@ pub struct RoomEventFilter<'a> {
|
||||
#[cfg(feature = "unstable-msc3440")]
|
||||
#[serde(
|
||||
rename = "io.element.relation_senders",
|
||||
alias = "related_by_senders",
|
||||
default,
|
||||
skip_serializing_if = "<[_]>::is_empty"
|
||||
)]
|
||||
|
@ -39,7 +39,12 @@ pub mod v3 {
|
||||
/// [MSC2448](https://github.com/matrix-org/matrix-spec-proposals/pull/2448).
|
||||
#[ruma_api(query)]
|
||||
#[cfg(feature = "unstable-msc2448")]
|
||||
#[serde(default, skip_serializing_if = "ruma_common::serde::is_default", rename = "xyz.amorgan.blurhash")]
|
||||
#[serde(
|
||||
default,
|
||||
skip_serializing_if = "ruma_common::serde::is_default",
|
||||
rename = "xyz.amorgan.generate_blurhash",
|
||||
alias = "generate_blurhash"
|
||||
)]
|
||||
pub generate_blurhash: bool,
|
||||
}
|
||||
|
||||
@ -52,7 +57,11 @@ pub mod v3 {
|
||||
/// This uses the unstable prefix in
|
||||
/// [MSC2448](https://github.com/matrix-org/matrix-spec-proposals/pull/2448).
|
||||
#[cfg(feature = "unstable-msc2448")]
|
||||
#[serde(rename = "xyz.amorgan.blurhash", skip_serializing_if = "Option::is_none")]
|
||||
#[serde(
|
||||
rename = "xyz.amorgan.blurhash",
|
||||
alias = "blurhash",
|
||||
skip_serializing_if = "Option::is_none"
|
||||
)]
|
||||
pub blurhash: Option<String>,
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,11 @@ pub mod v3 {
|
||||
/// This uses the unstable prefix in
|
||||
/// [MSC2448](https://github.com/matrix-org/matrix-spec-proposals/pull/2448).
|
||||
#[cfg(feature = "unstable-msc2448")]
|
||||
#[serde(rename = "xyz.amorgan.blurhash", skip_serializing_if = "Option::is_none")]
|
||||
#[serde(
|
||||
rename = "xyz.amorgan.blurhash",
|
||||
alias = "blurhash",
|
||||
skip_serializing_if = "Option::is_none"
|
||||
)]
|
||||
pub blurhash: Option<String>,
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,11 @@ pub mod v3 {
|
||||
/// This uses the unstable prefix in
|
||||
/// [MSC2448](https://github.com/matrix-org/matrix-spec-proposals/pull/2448).
|
||||
#[cfg(feature = "unstable-msc2448")]
|
||||
#[serde(rename = "xyz.amorgan.blurhash", skip_serializing_if = "Option::is_none")]
|
||||
#[serde(
|
||||
rename = "xyz.amorgan.blurhash",
|
||||
alias = "blurhash",
|
||||
skip_serializing_if = "Option::is_none"
|
||||
)]
|
||||
pub blurhash: Option<String>,
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,11 @@ pub mod v3 {
|
||||
/// This uses the unstable prefix in
|
||||
/// [MSC2448](https://github.com/matrix-org/matrix-spec-proposals/pull/2448).
|
||||
#[cfg(feature = "unstable-msc2448")]
|
||||
#[serde(rename = "xyz.amorgan.blurhash", skip_serializing_if = "Option::is_none")]
|
||||
#[serde(
|
||||
rename = "xyz.amorgan.blurhash",
|
||||
alias = "blurhash",
|
||||
skip_serializing_if = "Option::is_none"
|
||||
)]
|
||||
pub blurhash: Option<&'a str>,
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user