Add alt_aliases to CanonicalAliasEventContent

This commit is contained in:
Timo Kösters 2020-05-30 17:51:23 +02:00 committed by GitHub
parent e05fdf84fd
commit 4d09416cd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -1,5 +1,9 @@
# [unreleased]
Breaking changes:
* Add `alt_aliases` to `CanonicalAliasEventContent`
# 0.21.3
Bug fixes:

View File

@ -18,6 +18,12 @@ ruma_event! {
skip_serializing_if = "Option::is_none"
)]
pub alias: Option<RoomAliasId>,
/// List of alternative aliases to the room.
#[serde(
default,
skip_serializing_if = "Vec::is_empty"
)]
pub alt_aliases: Vec<RoomAliasId>,
},
}
}
@ -40,6 +46,7 @@ mod tests {
let canonical_alias_event = CanonicalAliasEvent {
content: CanonicalAliasEventContent {
alias: Some(RoomAliasId::try_from("#somewhere:localhost").unwrap()),
alt_aliases: Vec::new(),
},
event_id: EventId::try_from("$h29iv0s8:example.com").unwrap(),
origin_server_ts: UNIX_EPOCH + Duration::from_millis(1),