diff --git a/crates/ruma-client-api/src/space.rs b/crates/ruma-client-api/src/space.rs index d7dc70e9..a8a30def 100644 --- a/crates/ruma-client-api/src/space.rs +++ b/crates/ruma-client-api/src/space.rs @@ -6,7 +6,7 @@ use js_int::UInt; use ruma_common::{ - events::space::child::HierarchySpaceChildStateEvent, + events::space::child::HierarchySpaceChildEvent, room::RoomType, serde::{Raw, StringEnum}, MxcUri, RoomAliasId, RoomId, RoomName, @@ -75,7 +75,7 @@ pub struct SpaceHierarchyRoomsChunk { /// The stripped `m.space.child` events of the space-room. /// /// If the room is not a space-room, this should be empty. - pub children_state: Vec>, + pub children_state: Vec>, } /// Initial set of mandatory fields of `SpaceHierarchyRoomsChunk`. @@ -105,7 +105,7 @@ pub struct SpaceHierarchyRoomsChunkInit { /// The stripped `m.space.child` events of the space-room. /// /// If the room is not a space-room, this should be empty. - pub children_state: Vec>, + pub children_state: Vec>, } impl From for SpaceHierarchyRoomsChunk { diff --git a/crates/ruma-common/src/events/space/child.rs b/crates/ruma-common/src/events/space/child.rs index 25ae2256..72351291 100644 --- a/crates/ruma-common/src/events/space/child.rs +++ b/crates/ruma-common/src/events/space/child.rs @@ -55,7 +55,7 @@ impl SpaceChildEventContent { /// key. #[derive(Clone, Debug, Event)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] -pub struct HierarchySpaceChildStateEvent { +pub struct HierarchySpaceChildEvent { /// The content of the space child event. pub content: SpaceChildEventContent, @@ -76,7 +76,7 @@ mod tests { use matches::assert_matches; use serde_json::{from_value as from_json_value, json, to_value as to_json_value}; - use super::{HierarchySpaceChildStateEvent, SpaceChildEventContent}; + use super::{HierarchySpaceChildEvent, SpaceChildEventContent}; #[test] fn space_child_serialization() { @@ -106,7 +106,7 @@ mod tests { #[test] fn hierarchy_space_child_serialization() { - let event = HierarchySpaceChildStateEvent { + let event = HierarchySpaceChildEvent { content: SpaceChildEventContent { via: Some(vec![server_name!("example.com").to_owned()]), order: Some("uwu".to_owned()), @@ -146,8 +146,8 @@ mod tests { }); assert_matches!( - from_json_value::(json).unwrap(), - HierarchySpaceChildStateEvent { + from_json_value::(json).unwrap(), + HierarchySpaceChildEvent { content: SpaceChildEventContent { via: Some(via), order: None, diff --git a/crates/ruma-federation-api/src/space.rs b/crates/ruma-federation-api/src/space.rs index d6ff0ee9..94d2bcb5 100644 --- a/crates/ruma-federation-api/src/space.rs +++ b/crates/ruma-federation-api/src/space.rs @@ -2,8 +2,8 @@ use js_int::UInt; use ruma_common::{ - directory::PublicRoomJoinRule, events::space::child::HierarchySpaceChildStateEvent, - room::RoomType, serde::Raw, MxcUri, RoomAliasId, RoomId, RoomName, + directory::PublicRoomJoinRule, events::space::child::HierarchySpaceChildEvent, room::RoomType, + serde::Raw, MxcUri, RoomAliasId, RoomId, RoomName, }; use serde::{Deserialize, Serialize}; @@ -67,7 +67,7 @@ pub struct SpaceHierarchyParentSummary { /// The stripped `m.space.child` events of the space-room. /// /// If the room is not a space-room, this should be empty. - pub children_state: Vec>, + pub children_state: Vec>, /// If the room is a restricted room, these are the room IDs which are specified by the join /// rules. @@ -102,7 +102,7 @@ pub struct SpaceHierarchyParentSummaryInit { /// The stripped `m.space.child` events of the space-room. /// /// If the room is not a space-room, this should be empty. - pub children_state: Vec>, + pub children_state: Vec>, /// If the room is a restricted room, these are the room IDs which are specified by the join /// rules. diff --git a/crates/ruma-macros/src/events/event_parse.rs b/crates/ruma-macros/src/events/event_parse.rs index af6b031b..69af061a 100644 --- a/crates/ruma-macros/src/events/event_parse.rs +++ b/crates/ruma-macros/src/events/event_parse.rs @@ -100,7 +100,7 @@ impl fmt::Display for EventKind { EventKind::ToDevice => write!(f, "ToDeviceEvent"), EventKind::RoomRedaction => write!(f, "RoomRedactionEvent"), EventKind::Presence => write!(f, "PresenceEvent"), - EventKind::HierarchySpaceChild => write!(f, "HierarchySpaceChildStateEvent"), + EventKind::HierarchySpaceChild => write!(f, "HierarchySpaceChildEvent"), EventKind::Decrypted => unreachable!(), } } @@ -214,7 +214,7 @@ pub fn to_kind_variation(ident: &Ident) -> Option<(EventKind, EventKindVariation "RedactedSyncStateEvent" => Some((EventKind::State, EventKindVariation::RedactedSync)), "ToDeviceEvent" => Some((EventKind::ToDevice, EventKindVariation::Full)), "PresenceEvent" => Some((EventKind::Presence, EventKindVariation::Full)), - "HierarchySpaceChildStateEvent" => { + "HierarchySpaceChildEvent" => { Some((EventKind::HierarchySpaceChild, EventKindVariation::Stripped)) } "RoomRedactionEvent" => Some((EventKind::RoomRedaction, EventKindVariation::Full)),