events: Move space events from unstable-pre-spec to unstable-spec

This commit is contained in:
Jonas Platte 2022-02-01 22:02:23 +01:00
parent 2706f24688
commit f46c7a643f
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
6 changed files with 17 additions and 15 deletions

View File

@ -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",
}

View File

@ -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;

View File

@ -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<RoomType>,
}
@ -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"
);

View File

@ -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;

View File

@ -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;

View File

@ -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;