From f46c7a643f8f51b12800a5b36b242724e349edcc Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Tue, 1 Feb 2022 22:02:23 +0100 Subject: [PATCH] events: Move space events from unstable-pre-spec to unstable-spec --- crates/ruma-events/src/enums.rs | 4 ++-- crates/ruma-events/src/lib.rs | 2 +- crates/ruma-events/src/room/create.rs | 13 +++++++------ crates/ruma-events/src/space.rs | 5 +---- crates/ruma-events/src/space/child.rs | 4 +++- crates/ruma-events/src/space/parent.rs | 4 +++- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/crates/ruma-events/src/enums.rs b/crates/ruma-events/src/enums.rs index 28a48dc1..d38a8742 100644 --- a/crates/ruma-events/src/enums.rs +++ b/crates/ruma-events/src/enums.rs @@ -73,9 +73,9 @@ event_enum! { "m.room.third_party_invite", "m.room.tombstone", "m.room.topic", - #[cfg(feature = "unstable-pre-spec")] + #[cfg(feature = "unstable-spec")] "m.space.child", - #[cfg(feature = "unstable-pre-spec")] + #[cfg(feature = "unstable-spec")] "m.space.parent", } diff --git a/crates/ruma-events/src/lib.rs b/crates/ruma-events/src/lib.rs index dd7875a3..0ae712f0 100644 --- a/crates/ruma-events/src/lib.rs +++ b/crates/ruma-events/src/lib.rs @@ -175,7 +175,7 @@ pub mod room; pub mod room_key; pub mod room_key_request; pub mod secret; -#[cfg(feature = "unstable-pre-spec")] +#[cfg(feature = "unstable-spec")] pub mod space; pub mod sticker; pub mod tag; diff --git a/crates/ruma-events/src/room/create.rs b/crates/ruma-events/src/room/create.rs index d97e0afc..8a6b53f9 100644 --- a/crates/ruma-events/src/room/create.rs +++ b/crates/ruma-events/src/room/create.rs @@ -45,7 +45,7 @@ pub struct RoomCreateEventContent { /// The room type. /// /// This is currently only used for spaces. - #[cfg(feature = "unstable-pre-spec")] + #[cfg(feature = "unstable-spec")] #[serde(skip_serializing_if = "Option::is_none", rename = "type")] pub room_type: Option, } @@ -58,7 +58,7 @@ impl RoomCreateEventContent { federate: true, room_version: default_room_version_id(), predecessor: None, - #[cfg(feature = "unstable-pre-spec")] + #[cfg(feature = "unstable-spec")] room_type: None, } } @@ -69,6 +69,7 @@ impl RoomCreateEventContent { /// This type can hold an arbitrary string. To check for formats that are not available as a /// documented variant here, use its string representation, obtained through `.as_str()`. #[derive(Clone, Debug, PartialEq, Eq, StringEnum)] +#[cfg(feature = "unstable-spec")] #[non_exhaustive] pub enum RoomType { /// Defines the room as a space. @@ -118,7 +119,7 @@ mod tests { use super::RoomCreateEventContent; - #[cfg(feature = "unstable-pre-spec")] + #[cfg(feature = "unstable-spec")] use super::RoomType; #[test] @@ -128,7 +129,7 @@ mod tests { federate: false, room_version: RoomVersionId::V4, predecessor: None, - #[cfg(feature = "unstable-pre-spec")] + #[cfg(feature = "unstable-spec")] room_type: None, }; @@ -141,7 +142,7 @@ mod tests { assert_eq!(to_json_value(&content).unwrap(), json); } - #[cfg(feature = "unstable-pre-spec")] + #[cfg(feature = "unstable-spec")] #[test] fn space_serialization() { let content = RoomCreateEventContent { @@ -177,7 +178,7 @@ mod tests { federate: true, room_version: RoomVersionId::V4, predecessor: None, - #[cfg(feature = "unstable-pre-spec")] + #[cfg(feature = "unstable-spec")] room_type: None, } if creator == "@carl:example.com" ); diff --git a/crates/ruma-events/src/space.rs b/crates/ruma-events/src/space.rs index 52b285e4..4bf705dc 100644 --- a/crates/ruma-events/src/space.rs +++ b/crates/ruma-events/src/space.rs @@ -1,9 +1,6 @@ //! Types for the `m.space` events. //! -//! See [MSC2758] and [MSC1772]. -//! -//! [MSC2758]: https://github.com/matrix-org/matrix-doc/blob/master/proposals/2758-textual-id-grammar.md -//! [MSC1772]: https://github.com/matrix-org/matrix-doc/blob/master/proposals/1772-groups-as-rooms.md +//! See [the unstable specification](https://spec.matrix.org/unstable/client-server-api/#spaces). pub mod child; pub mod parent; diff --git a/crates/ruma-events/src/space/child.rs b/crates/ruma-events/src/space/child.rs index 0c4fba5b..1fc2d60c 100644 --- a/crates/ruma-events/src/space/child.rs +++ b/crates/ruma-events/src/space/child.rs @@ -1,4 +1,6 @@ -//! Types for the `m.space.child` event. +//! Types for the [`m.space.child`] event. +//! +//! [`m.space.child`]: https://spec.matrix.org/unstable/client-server-api/#mspacechild use ruma_events_macros::EventContent; use ruma_identifiers::ServerName; diff --git a/crates/ruma-events/src/space/parent.rs b/crates/ruma-events/src/space/parent.rs index 918d4de2..ba9eedb6 100644 --- a/crates/ruma-events/src/space/parent.rs +++ b/crates/ruma-events/src/space/parent.rs @@ -1,4 +1,6 @@ -//! Types for the `m.space.child` event. +//! Types for the [`m.space.parent`] event. +//! +//! [`m.space.parent`]: https://spec.matrix.org/unstable/client-server-api/#mspaceparent use ruma_events_macros::EventContent; use ruma_identifiers::ServerName;