common: Add compatibility hack for empty-string canonical_alias

This commit is contained in:
Jonas Platte 2021-12-09 12:38:30 +01:00
parent 28371945de
commit 7ebe660402
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67

View File

@ -25,6 +25,10 @@ pub struct PublicRoomsChunk {
/// The canonical alias of the room, if any.
#[serde(skip_serializing_if = "Option::is_none")]
#[cfg_attr(
feature = "compat",
serde(default, deserialize_with = "ruma_serde::empty_string_as_none")
)]
pub canonical_alias: Option<Box<RoomAliasId>>,
/// The name of the room, if any.