diff --git a/ruma-client-api/CHANGELOG.md b/ruma-client-api/CHANGELOG.md index d448926c..ae47ab7d 100644 --- a/ruma-client-api/CHANGELOG.md +++ b/ruma-client-api/CHANGELOG.md @@ -24,6 +24,7 @@ Improvements: * Add method `into_event_content` for `r0::room::create_room::CreationContent` * Add room visibility endpoints: `r0::directory::{get_room_visibility, set_room_visibility}`. * Add is_empty helpers for structs in `r0::sync::sync_events` +* Add a constructor for `r0::room::create_room::Request` Deprecations: diff --git a/ruma-client-api/src/r0/room/create_room.rs b/ruma-client-api/src/r0/room/create_room.rs index ce842692..baedf75c 100644 --- a/ruma-client-api/src/r0/room/create_room.rs +++ b/ruma-client-api/src/r0/room/create_room.rs @@ -92,6 +92,26 @@ ruma_api! { error: crate::Error } +impl Request { + /// Creates a `Request` will all-default parameters. + pub fn new() -> Self { + Self { + creation_content: None, + initial_state: Vec::new(), + invite: Vec::new(), + invite_3pid: Vec::new(), + is_direct: None, + name: None, + power_level_content_override: None, + preset: None, + room_alias_name: None, + room_version: None, + topic: None, + visibility: None, + } + } +} + /// Extra options to be added to the `m.room.create` event. /// /// This is the same as the event content struct for `m.room.create`, but without some fields that